Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758427AbYLKTYE (ORCPT ); Thu, 11 Dec 2008 14:24:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757515AbYLKTSX (ORCPT ); Thu, 11 Dec 2008 14:18:23 -0500 Received: from kroah.org ([198.145.64.141]:55926 "EHLO coco.kroah.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756966AbYLKTSL (ORCPT ); Thu, 11 Dec 2008 14:18:11 -0500 Date: Thu, 11 Dec 2008 11:14:06 -0800 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , Willy Tarreau , Rodrigo Rubira Branco , Jake Edge , Eugene Teo , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Hidehiro Kawai , Jan Kara , Eric Sandeen Subject: [patch 17/83] jbd: test BH_Write_EIO to detect errors on metadata buffers Message-ID: <20081211191406.GQ5894@kroah.com> References: <20081211190201.612240183@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="jbd-test-bh_write_eio-to-detect-errors-on-metadata-buffers.patch" In-Reply-To: <20081211191014.GA5759@suse.de> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2282 Lines: 62 2.6.27-stable review patch. If anyone has any objections, please let us know. ------------------ From: Hidehiro Kawai commit 9f818b4ac04f53458d0354950b4f229f54be4dbf upstream. __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. Signed-off-by: Hidehiro Kawai Acked-by: Jan Kara Acked-by: Eric Sandeen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- fs/jbd/checkpoint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/fs/jbd/checkpoint.c +++ b/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); @@ -199,7 +199,7 @@ restart: spin_lock(&journal->j_list_lock); goto restart; } - if (unlikely(!buffer_uptodate(bh))) + if (unlikely(buffer_write_io_error(bh))) ret = -EIO; /* @@ -268,7 +268,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-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/