]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: clear oneshot options on mount and remount
authorBoris Burkov <boris@bur.io>
Wed, 18 Nov 2020 23:06:20 +0000 (15:06 -0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Dec 2020 18:16:08 +0000 (19:16 +0100)
commitd5715bdf40f0bccf55058ab61a0c9e641e3f36c9
treee221c6b5f55b927b0b51c00a64b0a519edc46095
parent689130ba8d818fb3412e1a4374610e3782e47e49
btrfs: clear oneshot options on mount and remount

Some options only apply during mount time and are cleared at the end
of mount. For now, the example is USEBACKUPROOT, but CLEAR_CACHE also
fits the bill, and this is a preparation patch for also clearing that
option.

One subtlety is that the current code only resets USEBACKUPROOT on rw
mounts, but the option is meaningfully "consumed" by a ro mount, so it
feels appropriate to clear in that case as well. A subsequent read-write
remount would not go through open_ctree, which is the only place that
checks the option, so the change should be benign.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/super.c