btrfs: check the root node for uptodate before returning it
authorJosef Bacik <josef@toxicpanda.com>
Wed, 24 Nov 2021 19:14:24 +0000 (14:14 -0500)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:23 +0000 (14:18 +0100)
commit120de408e4b97504a2d9b5ca534b383de2c73d49
treee66ce56ef7c73424f7605eb9edc326a6f9f563d1
parenta174c0a2e857081195db6888323802f0fae793ef
btrfs: check the root node for uptodate before returning it

Now that we clear the extent buffer uptodate if we fail to write it out
we need to check to see if our root node is uptodate before we search
down it.  Otherwise we could return stale data (or potentially corrupt
data that was caught by the write verification step) and think that the
path is OK to search down.

CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c