public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers
@ 2008-09-09  8:42 Hidehiro Kawai
  2008-09-09 15:52 ` Jan Kara
  2008-09-11 18:56 ` Eric Sandeen
  0 siblings, 2 replies; 3+ messages in thread
From: Hidehiro Kawai @ 2008-09-09  8:42 UTC (permalink / raw)
  To: akpm, sct
  Cc: linux-kernel, linux-ext4, jack, jbacik, cmm, tytso, adilger,
	yumiko.sugita.yf, satoshi.oshima.fk, nickpiggin

__try_to_free_cp_buf(), __process_buffer(), and __wait_cp_io()
test BH_Uptodate flag to detect write I/O errors on metadata
buffers.  But by commit 95450f5a7e53d5752ce1a0d0b8282e10fe745ae0
"ext3: don't read inode block if the buffer has a write error"(*),
BH_Uptodate flag can be set to inode buffers with BH_Write_EIO
in order to avoid reading old inode data.  So now, we have to
test BH_Write_EIO flag of checkpointing inode buffers instead
of BH_Uptodate.  This patch does it.

(*) http://lkml.org/lkml/2008/6/23/126

This patch depends on the following patch set in -mm:

#1 jbd: abort when failed to log metadata buffers
   http://lkml.org/lkml/2008/7/24/160
#2 jbd: fix error handling for checkpoint io
   http://lkml.org/lkml/2008/7/24/163
#3 ext3: add checks for errors from jbd
   http://lkml.org/lkml/2008/7/29/539
#4 jbd: don't dirty original metadata buffer on abort
   http://lkml.org/lkml/2008/7/24/168

Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
---
 fs/jbd/checkpoint.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
===================================================================
--- linux-2.6.27-rc5-mm1.orig/fs/jbd/checkpoint.c
+++ linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
@@ -94,7 +94,7 @@ static int __try_to_free_cp_buf(struct j
 	struct buffer_head *bh = jh2bh(jh);
 
 	if (jh->b_jlist == BJ_None && !buffer_locked(bh) &&
-	    !buffer_dirty(bh) && buffer_uptodate(bh)) {
+	    !buffer_dirty(bh) && !buffer_write_io_error(bh)) {
 		JBUFFER_TRACE(jh, "remove from checkpoint list");
 		ret = __journal_remove_checkpoint(jh) + 1;
 		jbd_unlock_bh_state(bh);
@@ -214,7 +214,7 @@ restart:
 			spin_lock(&journal->j_list_lock);
 			goto restart;
 		}
-		if (unlikely(!buffer_uptodate(bh)))
+		if (unlikely(buffer_write_io_error(bh)))
 			ret = -EIO;
 
 		/*
@@ -283,7 +283,7 @@ static int __process_buffer(journal_t *j
 		ret = 1;
 	} else if (!buffer_dirty(bh)) {
 		ret = 1;
-		if (unlikely(!buffer_uptodate(bh)))
+		if (unlikely(buffer_write_io_error(bh)))
 			ret = -EIO;
 		J_ASSERT_JH(jh, !buffer_jbddirty(bh));
 		BUFFER_TRACE(bh, "remove from checkpoint");



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

* Re: [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers
  2008-09-09  8:42 [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers Hidehiro Kawai
@ 2008-09-09 15:52 ` Jan Kara
  2008-09-11 18:56 ` Eric Sandeen
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2008-09-09 15:52 UTC (permalink / raw)
  To: Hidehiro Kawai
  Cc: akpm, sct, linux-kernel, linux-ext4, jack, jbacik, cmm, tytso,
	adilger, yumiko.sugita.yf, satoshi.oshima.fk, nickpiggin

On Tue 09-09-08 17:42:41, Hidehiro Kawai wrote:
> __try_to_free_cp_buf(), __process_buffer(), and __wait_cp_io()
> test BH_Uptodate flag to detect write I/O errors on metadata
> buffers.  But by commit 95450f5a7e53d5752ce1a0d0b8282e10fe745ae0
> "ext3: don't read inode block if the buffer has a write error"(*),
> BH_Uptodate flag can be set to inode buffers with BH_Write_EIO
> in order to avoid reading old inode data.  So now, we have to
> test BH_Write_EIO flag of checkpointing inode buffers instead
> of BH_Uptodate.  This patch does it.
  Your changes look sane. Thanks for fixing this.
You can add Acked-by: Jan Kara <jack@suse.cz>

							Honza
> 
> (*) http://lkml.org/lkml/2008/6/23/126
> 
> This patch depends on the following patch set in -mm:
> 
> #1 jbd: abort when failed to log metadata buffers
>    http://lkml.org/lkml/2008/7/24/160
> #2 jbd: fix error handling for checkpoint io
>    http://lkml.org/lkml/2008/7/24/163
> #3 ext3: add checks for errors from jbd
>    http://lkml.org/lkml/2008/7/29/539
> #4 jbd: don't dirty original metadata buffer on abort
>    http://lkml.org/lkml/2008/7/24/168
> 
> Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
> ---
>  fs/jbd/checkpoint.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
> ===================================================================
> --- linux-2.6.27-rc5-mm1.orig/fs/jbd/checkpoint.c
> +++ linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
> @@ -94,7 +94,7 @@ static int __try_to_free_cp_buf(struct j
>  	struct buffer_head *bh = jh2bh(jh);
>  
>  	if (jh->b_jlist == BJ_None && !buffer_locked(bh) &&
> -	    !buffer_dirty(bh) && buffer_uptodate(bh)) {
> +	    !buffer_dirty(bh) && !buffer_write_io_error(bh)) {
>  		JBUFFER_TRACE(jh, "remove from checkpoint list");
>  		ret = __journal_remove_checkpoint(jh) + 1;
>  		jbd_unlock_bh_state(bh);
> @@ -214,7 +214,7 @@ restart:
>  			spin_lock(&journal->j_list_lock);
>  			goto restart;
>  		}
> -		if (unlikely(!buffer_uptodate(bh)))
> +		if (unlikely(buffer_write_io_error(bh)))
>  			ret = -EIO;
>  
>  		/*
> @@ -283,7 +283,7 @@ static int __process_buffer(journal_t *j
>  		ret = 1;
>  	} else if (!buffer_dirty(bh)) {
>  		ret = 1;
> -		if (unlikely(!buffer_uptodate(bh)))
> +		if (unlikely(buffer_write_io_error(bh)))
>  			ret = -EIO;
>  		J_ASSERT_JH(jh, !buffer_jbddirty(bh));
>  		BUFFER_TRACE(bh, "remove from checkpoint");
> 
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

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

* Re: [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers
  2008-09-09  8:42 [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers Hidehiro Kawai
  2008-09-09 15:52 ` Jan Kara
@ 2008-09-11 18:56 ` Eric Sandeen
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Sandeen @ 2008-09-11 18:56 UTC (permalink / raw)
  To: Hidehiro Kawai
  Cc: akpm, sct, linux-kernel, linux-ext4, jack, jbacik, cmm, tytso,
	adilger, yumiko.sugita.yf, satoshi.oshima.fk, nickpiggin

Hidehiro Kawai wrote:
> __try_to_free_cp_buf(), __process_buffer(), and __wait_cp_io()
> test BH_Uptodate flag to detect write I/O errors on metadata
> buffers.  But by commit 95450f5a7e53d5752ce1a0d0b8282e10fe745ae0
> "ext3: don't read inode block if the buffer has a write error"(*),
> BH_Uptodate flag can be set to inode buffers with BH_Write_EIO
> in order to avoid reading old inode data.  So now, we have to
> test BH_Write_EIO flag of checkpointing inode buffers instead
> of BH_Uptodate.  This patch does it.
> 
> (*) http://lkml.org/lkml/2008/6/23/126
> 
> This patch depends on the following patch set in -mm:
> 
> #1 jbd: abort when failed to log metadata buffers
>    http://lkml.org/lkml/2008/7/24/160
> #2 jbd: fix error handling for checkpoint io
>    http://lkml.org/lkml/2008/7/24/163
> #3 ext3: add checks for errors from jbd
>    http://lkml.org/lkml/2008/7/29/539
> #4 jbd: don't dirty original metadata buffer on abort
>    http://lkml.org/lkml/2008/7/24/168
> 
> Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
> ---
Thanks, you can add

Acked-by: Eric Sandeen <sandeen@redhat.com>

too.

>  fs/jbd/checkpoint.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Index: linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
> ===================================================================
> --- linux-2.6.27-rc5-mm1.orig/fs/jbd/checkpoint.c
> +++ linux-2.6.27-rc5-mm1/fs/jbd/checkpoint.c
> @@ -94,7 +94,7 @@ static int __try_to_free_cp_buf(struct j
>  	struct buffer_head *bh = jh2bh(jh);
>  
>  	if (jh->b_jlist == BJ_None && !buffer_locked(bh) &&
> -	    !buffer_dirty(bh) && buffer_uptodate(bh)) {
> +	    !buffer_dirty(bh) && !buffer_write_io_error(bh)) {
>  		JBUFFER_TRACE(jh, "remove from checkpoint list");
>  		ret = __journal_remove_checkpoint(jh) + 1;
>  		jbd_unlock_bh_state(bh);
> @@ -214,7 +214,7 @@ restart:
>  			spin_lock(&journal->j_list_lock);
>  			goto restart;
>  		}
> -		if (unlikely(!buffer_uptodate(bh)))
> +		if (unlikely(buffer_write_io_error(bh)))
>  			ret = -EIO;
>  
>  		/*
> @@ -283,7 +283,7 @@ static int __process_buffer(journal_t *j
>  		ret = 1;
>  	} else if (!buffer_dirty(bh)) {
>  		ret = 1;
> -		if (unlikely(!buffer_uptodate(bh)))
> +		if (unlikely(buffer_write_io_error(bh)))
>  			ret = -EIO;
>  		J_ASSERT_JH(jh, !buffer_jbddirty(bh));
>  		BUFFER_TRACE(bh, "remove from checkpoint");
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2008-09-11 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-09  8:42 [PATCH -mm] jbd: test BH_Write_EIO to detect errors on metadata buffers Hidehiro Kawai
2008-09-09 15:52 ` Jan Kara
2008-09-11 18:56 ` Eric Sandeen

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