]> www.infradead.org Git - users/jedix/linux-maple.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>
Tue, 6 Apr 2021 13:35:54 +0000 (15:35 +0200)
commit1c256d1564425c2159fadd49ff7cc6b5c4ef990d
tree8fd1d8799b5727684392170938670f72e9957c3e
parenta4dc0262a86a184b6a3f48bc50f778d223d1b5c7
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 125c4cf9f37c98
("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 487781796d3022 ("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