btrfs: make sure SB_I_VERSION doesn't get unset by remount
commitd256992d5105d9d9882f9815a32ff181205e83ff
authorJosef Bacik <josef@toxicpanda.com>
Thu, 30 Jul 2020 15:18:09 +0000 (30 11:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 11:05:23 +0000 (21 13:05 +0200)
treee0bec1f159af91bd1414c461f3be76c3152ca24b
parent5bed3387c8a166590057770f6f7b60f1c46bec52
btrfs: make sure SB_I_VERSION doesn't get unset by remount

commit faa008899a4db21a2df99833cb4ff6fa67009a20 upstream.

There's some inconsistency around SB_I_VERSION handling with mount and
remount.  Since we don't really want it to be off ever just work around
this by making sure we don't get the flag cleared on remount.

There's a tiny cpu cost of setting the bit, otherwise all changes to
i_version also change some of the times (ctime/mtime) so the inode needs
to be synced. We wouldn't save anything by disabling it.

Reported-by: Eric Sandeen <sandeen@redhat.com>
CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add perf impact analysis ]
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/super.c