]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: remove stale comment and logic from btrfs_inode_in_log()
authorFilipe Manana <fdmanana@suse.com>
Tue, 23 Feb 2021 12:08:49 +0000 (12:08 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:16 +0000 (17:25 +0200)
commitd95c679be5ce357dfc7986e00c0fddc564bfd777
tree32b6c21cf60b189e0a69fbd5c1c10ef03b4334cc
parent12d346d0823e0c778cb114f9a9c31030dfae02ef
btrfs: remove stale comment and logic from btrfs_inode_in_log()

Currently btrfs_inode_in_log() checks the list of modified extents of the
inode, and has a comment mentioning why, as it used to be necessary to
make sure if we did something like the following:

  mmap write range A
  mmap write range B
  msync range A (ranged fsync)
  msync range B (ranged fsync)

we ended up with both ranges being logged.

If we did not check it, then the second fsync would do nothing because
btrfs_inode_in_log() would return true. This was added in 2aa30791b04189
("Btrfs: set inode's logged_trans/last_log_commit after ranged fsync") and
test case generic/325 from fstests exercises that scenario.

However, as of commit 6b97d2c8348d5b ("btrfs: make fast fsyncs wait only
for writeback"), every ranged fsync is now turned into a full ranged fsync
(operates on the range from 0 to LLONG_MAX), so it is now pointless to
test of emptiness of the list of modified extents, and the comment is
clearly outdated.

So just remove the comment and list emptiness check, while also changing
the function's return type to be a boolean instead of an integer.
In case one day we get support for ranged fsyncs again, it will be easy
to notice the check is necessary again, because it will make generic/325
always fail.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h