public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] JBD2: print io_block if check data block checksum failed when do recovery
@ 2023-09-04  1:10 Ye Bin
  2023-09-04  1:10 ` [PATCH 1/2] " Ye Bin
  2023-09-04  1:10 ` [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass() Ye Bin
  0 siblings, 2 replies; 5+ messages in thread
From: Ye Bin @ 2023-09-04  1:10 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4; +Cc: linux-kernel, jack, Ye Bin

Ye Bin (2):
  JBD2: print io_block if check data block checksum failed when do
    recovery
  JBD2: fix printk format type for 'io_block' in do_one_pass()

 fs/jbd2/recovery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.31.1


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

* [PATCH 1/2] JBD2: print io_block if check data block checksum failed when do recovery
  2023-09-04  1:10 [PATCH 0/2] JBD2: print io_block if check data block checksum failed when do recovery Ye Bin
@ 2023-09-04  1:10 ` Ye Bin
  2023-09-04  8:45   ` Jan Kara
  2023-09-04  1:10 ` [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass() Ye Bin
  1 sibling, 1 reply; 5+ messages in thread
From: Ye Bin @ 2023-09-04  1:10 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4; +Cc: linux-kernel, jack, Ye Bin

Now, if check data block checksum failed only print data's block number
then skip write data. However, one data block may in more than one transaction.
In some scenarios, offline analysis is inconvenient. As a result, it is
difficult to locate the areas where data is faulty.
So print 'io_block' if check data block checksum failed.

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 fs/jbd2/recovery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index c269a7d29a46..a2e2bdaed9f8 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -661,7 +661,8 @@ static int do_one_pass(journal_t *journal,
 						printk(KERN_ERR "JBD2: Invalid "
 						       "checksum recovering "
 						       "data block %llu in "
-						       "log\n", blocknr);
+						       "log %lu\n", blocknr,
+						       io_block);
 						block_error = 1;
 						goto skip_write;
 					}
-- 
2.31.1


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

* [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass()
  2023-09-04  1:10 [PATCH 0/2] JBD2: print io_block if check data block checksum failed when do recovery Ye Bin
  2023-09-04  1:10 ` [PATCH 1/2] " Ye Bin
@ 2023-09-04  1:10 ` Ye Bin
  2023-09-04  8:46   ` Jan Kara
  1 sibling, 1 reply; 5+ messages in thread
From: Ye Bin @ 2023-09-04  1:10 UTC (permalink / raw)
  To: tytso, adilger.kernel, linux-ext4; +Cc: linux-kernel, jack, Ye Bin

'io_block' is unsinged long but print it by '%ld'.

Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 fs/jbd2/recovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
index a2e2bdaed9f8..d10dc7f64301 100644
--- a/fs/jbd2/recovery.c
+++ b/fs/jbd2/recovery.c
@@ -632,7 +632,7 @@ static int do_one_pass(journal_t *journal,
 					success = err;
 					printk(KERN_ERR
 						"JBD2: IO error %d recovering "
-						"block %ld in log\n",
+						"block %lu in log\n",
 						err, io_block);
 				} else {
 					unsigned long long blocknr;
-- 
2.31.1


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

* Re: [PATCH 1/2] JBD2: print io_block if check data block checksum failed when do recovery
  2023-09-04  1:10 ` [PATCH 1/2] " Ye Bin
@ 2023-09-04  8:45   ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2023-09-04  8:45 UTC (permalink / raw)
  To: Ye Bin; +Cc: tytso, adilger.kernel, linux-ext4, linux-kernel, jack

On Mon 04-09-23 09:10:20, Ye Bin wrote:
> Now, if check data block checksum failed only print data's block number
> then skip write data. However, one data block may in more than one transaction.
> In some scenarios, offline analysis is inconvenient. As a result, it is
> difficult to locate the areas where data is faulty.
> So print 'io_block' if check data block checksum failed.
> 
> Signed-off-by: Ye Bin <yebin10@huawei.com>
> ---
>  fs/jbd2/recovery.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index c269a7d29a46..a2e2bdaed9f8 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -661,7 +661,8 @@ static int do_one_pass(journal_t *journal,
>  						printk(KERN_ERR "JBD2: Invalid "
>  						       "checksum recovering "
>  						       "data block %llu in "
> -						       "log\n", blocknr);
> +						       "log %lu\n", blocknr,

I'd make the message "...in journal block %lu\n". Otherwise the patch looks
good so feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass()
  2023-09-04  1:10 ` [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass() Ye Bin
@ 2023-09-04  8:46   ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2023-09-04  8:46 UTC (permalink / raw)
  To: Ye Bin; +Cc: tytso, adilger.kernel, linux-ext4, linux-kernel, jack

On Mon 04-09-23 09:10:21, Ye Bin wrote:
> 'io_block' is unsinged long but print it by '%ld'.
> 
> Signed-off-by: Ye Bin <yebin10@huawei.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/jbd2/recovery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/jbd2/recovery.c b/fs/jbd2/recovery.c
> index a2e2bdaed9f8..d10dc7f64301 100644
> --- a/fs/jbd2/recovery.c
> +++ b/fs/jbd2/recovery.c
> @@ -632,7 +632,7 @@ static int do_one_pass(journal_t *journal,
>  					success = err;
>  					printk(KERN_ERR
>  						"JBD2: IO error %d recovering "
> -						"block %ld in log\n",
> +						"block %lu in log\n",
>  						err, io_block);
>  				} else {
>  					unsigned long long blocknr;
> -- 
> 2.31.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2023-09-04  8:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-04  1:10 [PATCH 0/2] JBD2: print io_block if check data block checksum failed when do recovery Ye Bin
2023-09-04  1:10 ` [PATCH 1/2] " Ye Bin
2023-09-04  8:45   ` Jan Kara
2023-09-04  1:10 ` [PATCH 2/2] JBD2: fix printk format type for 'io_block' in do_one_pass() Ye Bin
2023-09-04  8:46   ` Jan Kara

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