Commit d135a533 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: remove no longer needed full sync flag check at inode_logged()

Now that we are checking if the inode's logged_trans is 0 to detect the
possibility of the inode having been evicted and reloaded, the test for
the full sync flag (BTRFS_INODE_NEEDS_FULL_SYNC) is no longer needed at
tree-log.c:inode_logged(). Its purpose was to detect the possibility
of a previous eviction as well, since when an inode is loaded the full
sync flag is always set on it (and only cleared after the inode is
logged).

So just remove the check and update the comment. The check for the inode's
logged_trans being 0 was added recently by the patch with the subject
"btrfs: eliminate some false positives when checking if inode was logged".
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1c167b87
...@@ -3435,16 +3435,14 @@ static bool inode_logged(struct btrfs_trans_handle *trans, ...@@ -3435,16 +3435,14 @@ static bool inode_logged(struct btrfs_trans_handle *trans,
/* /*
* The inode's logged_trans is always 0 when we load it (because it is * The inode's logged_trans is always 0 when we load it (because it is
* not persisted in the inode item or elsewhere). So if it is 0, the * not persisted in the inode item or elsewhere). So if it is 0, the
* inode was last modified in the current transaction and has the * inode was last modified in the current transaction then the inode may
* full_sync flag set, then the inode may have been logged before in * have been logged before in the current transaction, then evicted and
* the current transaction, then evicted and loaded again in the current * loaded again in the current transaction - or may have never been logged
* transaction - or may have never been logged in the current transaction, * in the current transaction, but since we can not be sure, we have to
* but since we can not be sure, we have to assume it was, otherwise our * assume it was, otherwise our callers can leave an inconsistent log.
* callers can leave an inconsistent log.
*/ */
if (inode->logged_trans == 0 && if (inode->logged_trans == 0 &&
inode->last_trans == trans->transid && inode->last_trans == trans->transid &&
test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, &inode->runtime_flags) &&
!test_bit(BTRFS_FS_LOG_RECOVERING, &trans->fs_info->flags)) !test_bit(BTRFS_FS_LOG_RECOVERING, &trans->fs_info->flags))
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment