Message ID | 20230309090526.332550-3-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/20] btrfs: mark extent_buffer_under_io static | expand |
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
On 2023/3/9 17:05, Christoph Hellwig wrote: > Setting the buffer uptodate in a function that is named as a validation > helper is a it confusing. Move the call from validate_extent_buffer to > the one of its two callers that didn't already have a duplicate call > to set_extent_buffer_uptodate. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > fs/btrfs/disk-io.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c > index bb864cf2eed60f..7d766eaef4aee7 100644 > --- a/fs/btrfs/disk-io.c > +++ b/fs/btrfs/disk-io.c > @@ -590,9 +590,7 @@ static int validate_extent_buffer(struct extent_buffer *eb, > if (found_level > 0 && btrfs_check_node(eb)) > ret = -EIO; > > - if (!ret) > - set_extent_buffer_uptodate(eb); > - else > + if (ret) > btrfs_err(fs_info, > "read time tree block corruption detected on logical %llu mirror %u", > eb->start, eb->read_mirror); > @@ -684,6 +682,8 @@ int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio, > goto err; > } > ret = validate_extent_buffer(eb, &bbio->parent_check); > + if (!ret) > + set_extent_buffer_uptodate(eb); > err: > if (ret) { > /*
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index bb864cf2eed60f..7d766eaef4aee7 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -590,9 +590,7 @@ static int validate_extent_buffer(struct extent_buffer *eb, if (found_level > 0 && btrfs_check_node(eb)) ret = -EIO; - if (!ret) - set_extent_buffer_uptodate(eb); - else + if (ret) btrfs_err(fs_info, "read time tree block corruption detected on logical %llu mirror %u", eb->start, eb->read_mirror); @@ -684,6 +682,8 @@ int btrfs_validate_metadata_buffer(struct btrfs_bio *bbio, goto err; } ret = validate_extent_buffer(eb, &bbio->parent_check); + if (!ret) + set_extent_buffer_uptodate(eb); err: if (ret) { /*
Setting the buffer uptodate in a function that is named as a validation helper is a it confusing. Move the call from validate_extent_buffer to the one of its two callers that didn't already have a duplicate call to set_extent_buffer_uptodate. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/btrfs/disk-io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)