Re: [PATCH] Btrfs: report errors when checksum is not found

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

 



On Tue, Jul 11, 2017 at 02:43:16PM -0600, Liu Bo wrote:
> When btrfs fails the checksum check, it'll fill the whole page with
> "1".

One could ask, why is the page filled with 1s. Brought by commit
07157aacb1ecd394a54949 from 2007, without mentioning any justification.
I'm more inclined to revisit this behaviour and drop it eventually.

> However, if %csum_expected is 0 (which means there is no checksum), then
> for some unknown reason, we just pretend that the read is correct, so
> userspace would be confused about the dilemma that read is successful but
> getting a page with all content being "1".

Here 'no checksum' means that no checksum was found but was expected,
right? An EIO would fail the read, I don't see a reason why the page
needs to be "zeroed". The contents would be inaccessible anyway.

> This can happen due to a bug in btrfs-convert.
> 
> This fixes it by always returning errors if checksum doesn't match.

Independent of the above, this fix makes sense.

Reviewed-by: David Sterba <dsterba@xxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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