Re: [PATCH v2 4/5] btrfs: disk-io: Show the timing of corrupted tree block explicitly

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

 



On 17/01/2019 14:42, Qu Wenruo wrote:
> 
> To show when the error happens.
> 
> This patch only handles the read time error, thus we have two same error
> message.
> 
> But the next patch will introduce new write time validation check, thus
> we need to distinguish then by the extra message.

OK, so if we really want the same message printed for all read time
errors, how about this:

        if (found_level == 0 && btrfs_check_leaf_full(fs_info, eb)) {
                set_bit(EXTENT_BUFFER_CORRUPT, &eb->bflags);
                ret = -EIO;
        }

        if (found_level > 0 && btrfs_check_node(fs_info, eb))
                ret = -EIO;

+	if (ret == -EIO)
+		btrfs_err(fs_info,
+			"read time tree block corruption detected");
+       else if (!ret)
-	if (!ret)
                set_extent_buffer_uptodate(eb);


So we really only have one message printed and not duplicating the prints.

Byte,
	Johannes
-- 
Johannes Thumshirn                            SUSE Labs Filesystems
jthumshirn@xxxxxxx                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850



[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