Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1766009AbXHWW2I (ORCPT ); Thu, 23 Aug 2007 18:28:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1764904AbXHWW1y (ORCPT ); Thu, 23 Aug 2007 18:27:54 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:50622 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1764928AbXHWW1x (ORCPT ); Thu, 23 Aug 2007 18:27:53 -0400 Date: Thu, 23 Aug 2007 15:25:52 -0700 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 , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Mark Fasheh Subject: [patch 01/28] ocfs2: Fix bad source start calculation during kernel writes Message-ID: <20070823222552.GB18559@kroah.com> References: <20070823220656.101239233@mini.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="ocfs2-fix-bad-source-start-calculation-during-kernel-writes.patch" In-Reply-To: <20070823221811.GA18559@kroah.com> User-Agent: Mutt/1.5.16 (2007-06-09) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 39 -stable review patch. If anyone has any objections, please let us know. ------------------ From: Mark Fasheh [PATCH] ocfs2: Fix bad source start calculation during kernel writes For in-kernel writes ocfs2_get_write_source() should be starting the buffer at a page boundary as the math in ocfs2_map_and_write_user_data() will pad it back out to the correct write offset. Instead, we were passing the raw offset, which caused ocfs2_map_and_write_user_data() start too far into the buffer, resulting in corruptions from nfs client writes. Signed-off-by: Mark Fasheh Signed-off-by: Greg Kroah-Hartman --- fs/ocfs2/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1353,7 +1353,7 @@ static struct page * ocfs2_get_write_sou else src_page = ERR_PTR(-EFAULT); } else { - bp->b_src_buf = buf; + bp->b_src_buf = (char *)((unsigned long)buf & PAGE_CACHE_MASK); } return src_page; -- - 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/