Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1672157

Re: [PATCH 32/32] ext4: add nombcache mount option

From Tahsin Erdogan <tahsin@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 32/32] ext4: add nombcache mount option
Date 2017-06-22 01:50 +0200
Message-ID <tUXxL-4Ng-7@gated-at.bofh.it> (permalink)
References <tUnui-6Hb-19@gated-at.bofh.it> <tUV2W-3fo-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


>> +     if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT4_MOUNT_NO_MBCACHE) {
>> +             ext4_msg(sb, KERN_ERR, "can't enable nombcache during remount");
>> +             err = -EINVAL;
>> +             goto restore_opts;
>> +     }
>
> It appears that this restriction also applies to enabling mbcache during
> remount as well, so the message should be updated?  In particular, if
> NO_MBCACHE is currently set but isn't passed during the remount then this
> will always cause the remount to fail.  That makes it harder for users to
> just run something like "mount -o remount,ro".

Remount option handling is a bit strange. If an option is not
specified, it is not automatically cleared in sbi->s_mount_opt. So,
once nombcache option is set in the original mount, it is not possible
to clear it. I don't know whether this option handling behavior in
ext4 is deliberate but because of that, the mount -o remount,ro does
not result in a mount failure. The check above is effectively only to
protect against going from not having nombcache option to having
nombcache option, because the opposite is not possible.

Following shows how "debug" option remains set even though it wasn't
specified during remount:

# mount -o debug /dev/sdb /mnt/sdb
# mount | grep sdb
/dev/sdb on /mnt/sdb type ext4 (rw,debug)
# cat /proc/mounts | grep sdb
/dev/sdb /mnt/sdb ext4 rw,relatime,debug,data=ordered 0 0
# mount -o remount,ro /dev/sdb /mnt/sdb
# mount | grep sdb
/dev/sdb on /mnt/sdb type ext4 (ro)
# cat /proc/mounts | grep sdb
/dev/sdb /mnt/sdb ext4 ro,relatime,debug,data=ordered 0 0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 32/32] ext4: add nombcache mount option Tahsin Erdogan <tahsin@google.com> - 2017-06-20 11:20 +0200
  Re: [PATCH 32/32] ext4: add nombcache mount option Andreas Dilger <adilger@dilger.ca> - 2017-06-21 23:10 +0200
    Re: [PATCH 32/32] ext4: add nombcache mount option Tahsin Erdogan <tahsin@google.com> - 2017-06-22 01:50 +0200
      Re: [PATCH 32/32] ext4: add nombcache mount option Theodore Ts'o <tytso@mit.edu> - 2017-06-22 06:50 +0200

csiph-web