All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio
@ 2023-05-26  9:01 Christoph Hellwig
  2023-05-26  9:05 ` Qu Wenruo
  2023-05-26 14:03 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-05-26  9:01 UTC (permalink / raw)
  To: dsterba, josef, clm; +Cc: quwenruo.btrfs, linux-btrfs

btree_csum_one_bio needs to use the btrfs_page_test_uptodate helper
to check for uptodate status as the page might not be marked uptodate
for a sub-page size buffer.

Fixes: 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")
Reported-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
---
 fs/btrfs/disk-io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index c461a46ac6f207..36d6b8d4b2c1fa 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -269,7 +269,8 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)
 
 	if (WARN_ON_ONCE(found_start != eb->start))
 		return BLK_STS_IOERR;
-	if (WARN_ON_ONCE(!PageUptodate(eb->pages[0])))
+	if (WARN_ON(!btrfs_page_test_uptodate(fs_info, eb->pages[0],
+					      eb->start, eb->len)))
 		return BLK_STS_IOERR;
 
 	ASSERT(memcmp_extent_buffer(eb, fs_info->fs_devices->metadata_uuid,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio
  2023-05-26  9:01 [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio Christoph Hellwig
@ 2023-05-26  9:05 ` Qu Wenruo
  2023-05-26 14:03 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Qu Wenruo @ 2023-05-26  9:05 UTC (permalink / raw)
  To: Christoph Hellwig, dsterba, josef, clm; +Cc: linux-btrfs



On 2023/5/26 17:01, Christoph Hellwig wrote:
> btree_csum_one_bio needs to use the btrfs_page_test_uptodate helper
> to check for uptodate status as the page might not be marked uptodate
> for a sub-page size buffer.
>
> Fixes: 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")
> Reported-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Tested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
>   fs/btrfs/disk-io.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index c461a46ac6f207..36d6b8d4b2c1fa 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -269,7 +269,8 @@ blk_status_t btree_csum_one_bio(struct btrfs_bio *bbio)
>
>   	if (WARN_ON_ONCE(found_start != eb->start))
>   		return BLK_STS_IOERR;
> -	if (WARN_ON_ONCE(!PageUptodate(eb->pages[0])))
> +	if (WARN_ON(!btrfs_page_test_uptodate(fs_info, eb->pages[0],
> +					      eb->start, eb->len)))
>   		return BLK_STS_IOERR;
>
>   	ASSERT(memcmp_extent_buffer(eb, fs_info->fs_devices->metadata_uuid,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio
  2023-05-26  9:01 [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio Christoph Hellwig
  2023-05-26  9:05 ` Qu Wenruo
@ 2023-05-26 14:03 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2023-05-26 14:03 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: dsterba, josef, clm, quwenruo.btrfs, linux-btrfs

On Fri, May 26, 2023 at 11:01:09AM +0200, Christoph Hellwig wrote:
> btree_csum_one_bio needs to use the btrfs_page_test_uptodate helper
> to check for uptodate status as the page might not be marked uptodate
> for a sub-page size buffer.
> 
> Fixes: 5067444c99c3 ("btrfs: remove the extent_buffer lookup in btree block checksumming")

Folded to the patch, thanks.

> Reported-by: Qu Wenruo <quwenruo.btrfs@gmx.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Tested-by: Qu Wenruo <quwenruo.btrfs@gmx.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-26 14:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-26  9:01 [PATCH] btrfs: fix the uptodate assert in btree_csum_one_bio Christoph Hellwig
2023-05-26  9:05 ` Qu Wenruo
2023-05-26 14:03 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.