]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
XFS: Fix memory corruption with small buffer reads
authorChristoph Hellwig <hch@infradead.org>
Wed, 28 May 2008 21:29:44 +0000 (17:29 -0400)
committerChris Wright <chrisw@sous-sol.org>
Mon, 9 Jun 2008 18:27:02 +0000 (11:27 -0700)
commit2486e8fca463e0f9e6edfebe07186cb7478c6a95
tree563911c0c5c723311c6c5706f572d9029670986f
parent6bdb15cddf9d758c825cf28678d1f903104d2134
XFS: Fix memory corruption with small buffer reads

upstream commit: 6ab455eeaff6893cd06da33843e840d888cdc04a

When we have multiple buffers in a single page for a blocksize == pagesize
filesystem we might overwrite the page contents if two callers hit it
shortly after each other. To prevent that we need to keep the page locked
until I/O is completed and the page marked uptodate.

Thanks to Eric Sandeen for triaging this bug and finding a reproducible
testcase and Dave Chinner for additional advice.

This should fix kernel.org bz #10421.

Tested-by: Eric Sandeen <sandeen@sandeen.net>
SGI-PV: 981813
SGI-Modid: xfs-linux-melb:xfs-kern:31173a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
fs/xfs/linux-2.6/xfs_buf.c
fs/xfs/linux-2.6/xfs_buf.h