public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: add root id output for direct IO error messages
@ 2025-05-19 23:00 Qu Wenruo
  2025-05-21  8:01 ` Daniel Vacek
  2025-05-28 13:43 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Qu Wenruo @ 2025-05-19 23:00 UTC (permalink / raw)
  To: linux-btrfs

When debugging a kernel warning caused by generic/475, the error
messages from direct IO lacks the subvolume id, meanwhile th error
messages from buffered IO contains both subvolume id and inode number.

This makes debugging much harder to grasp which inode (and its
subvolume) is causing the problem.

Add the subvolume id for direct IO failure message.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/direct-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c
index fe9a4bd7e6e6..983b8cb9f688 100644
--- a/fs/btrfs/direct-io.c
+++ b/fs/btrfs/direct-io.c
@@ -649,8 +649,8 @@ static void btrfs_dio_end_io(struct btrfs_bio *bbio)
 
 	if (bio->bi_status) {
 		btrfs_warn(inode->root->fs_info,
-		"direct IO failed ino %llu op 0x%0x offset %#llx len %u err no %d",
-			   btrfs_ino(inode), bio->bi_opf,
+		"direct IO failed root %llu ino %llu op 0x%0x offset %#llx len %u err no %d",
+			   btrfs_root_id(inode->root), btrfs_ino(inode), bio->bi_opf,
 			   dip->file_offset, dip->bytes, bio->bi_status);
 	}
 
-- 
2.49.0


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

* Re: [PATCH] btrfs: add root id output for direct IO error messages
  2025-05-19 23:00 [PATCH] btrfs: add root id output for direct IO error messages Qu Wenruo
@ 2025-05-21  8:01 ` Daniel Vacek
  2025-05-28 13:43 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vacek @ 2025-05-21  8:01 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Tue, 20 May 2025 at 01:00, Qu Wenruo <wqu@suse.com> wrote:
>
> When debugging a kernel warning caused by generic/475, the error
> messages from direct IO lacks the subvolume id, meanwhile th error
> messages from buffered IO contains both subvolume id and inode number.
>
> This makes debugging much harder to grasp which inode (and its
> subvolume) is causing the problem.
>
> Add the subvolume id for direct IO failure message.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: Daniel Vacek <neelx@suse.com>


> ---
>  fs/btrfs/direct-io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/direct-io.c b/fs/btrfs/direct-io.c
> index fe9a4bd7e6e6..983b8cb9f688 100644
> --- a/fs/btrfs/direct-io.c
> +++ b/fs/btrfs/direct-io.c
> @@ -649,8 +649,8 @@ static void btrfs_dio_end_io(struct btrfs_bio *bbio)
>
>         if (bio->bi_status) {
>                 btrfs_warn(inode->root->fs_info,
> -               "direct IO failed ino %llu op 0x%0x offset %#llx len %u err no %d",
> -                          btrfs_ino(inode), bio->bi_opf,
> +               "direct IO failed root %llu ino %llu op 0x%0x offset %#llx len %u err no %d",
> +                          btrfs_root_id(inode->root), btrfs_ino(inode), bio->bi_opf,
>                            dip->file_offset, dip->bytes, bio->bi_status);
>         }
>
> --
> 2.49.0
>
>

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

* Re: [PATCH] btrfs: add root id output for direct IO error messages
  2025-05-19 23:00 [PATCH] btrfs: add root id output for direct IO error messages Qu Wenruo
  2025-05-21  8:01 ` Daniel Vacek
@ 2025-05-28 13:43 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2025-05-28 13:43 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Tue, May 20, 2025 at 08:30:32AM +0930, Qu Wenruo wrote:
> When debugging a kernel warning caused by generic/475, the error
> messages from direct IO lacks the subvolume id, meanwhile th error
> messages from buffered IO contains both subvolume id and inode number.
> 
> This makes debugging much harder to grasp which inode (and its
> subvolume) is causing the problem.
> 
> Add the subvolume id for direct IO failure message.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>

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

end of thread, other threads:[~2025-05-28 13:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-19 23:00 [PATCH] btrfs: add root id output for direct IO error messages Qu Wenruo
2025-05-21  8:01 ` Daniel Vacek
2025-05-28 13:43 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox