Re: [PATCH v5.1 12/12] btrfs: Do mandatory tree block check before submitting bio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 18, 2019 at 05:32:56PM +0800, Qu Wenruo wrote:
> [snip]
> >>
> >> Reported-by: Leonard Lausen <leonard@xxxxxxxxx>
> >> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
> >> ---
> >>  fs/btrfs/disk-io.c      | 10 ++++++++++
> >>  fs/btrfs/tree-checker.c | 24 +++++++++++++++++++++---
> >>  fs/btrfs/tree-checker.h |  8 ++++++++
> >>  3 files changed, 39 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> >> index 6052ab508f84..fff789f8db63 100644
> >> --- a/fs/btrfs/disk-io.c
> >> +++ b/fs/btrfs/disk-io.c
> >> @@ -313,6 +313,16 @@ static int csum_tree_block(struct btrfs_fs_info *fs_info,
> >>  			return -EUCLEAN;
> >>  		}
> >>  	} else {
> >> +		if (btrfs_header_level(buf))
> >> +			err = btrfs_check_node(fs_info, buf);
> >> +		else
> >> +			err = btrfs_check_leaf_write(fs_info, buf);
> >> +		if (err < 0) {
> >> +			btrfs_err(fs_info,
> >> +			"block=%llu write time tree block corruption detected",
> >> +				  buf->start);
> >> +			return err;
> >> +		}
> > 
> > This code should be moved in csum_dirty_buffer. Currently there is
> > pending cleanups in csum_tree_block and the final if there will be
> > removed and respective read/write code factored out in
> > csum_dirty_buffer/btree_readpage_end_io_hook.
> 
> I have no preference here.
> As long as the timing isn't changed, I'm fine either way.
> 
> But at least, from my last check on misc-next, there is no conflict at
> all. So the pending cleanup isn't so pending right now?

The pending changes are probably from Johannes, that are still in the
mailinglist and I haven't processed them yet (ie. no misc-next or
for-next). My plan is to merge your patchset first, the cleanups can be
adapted more easily. As the merge window is approaching, all of that
will happen in a week or two.



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux