TAKE 981813 - Fix memory corruption with small buffer reads
David Chinner
Tested-by Eric SandeenFix memory corruption with small buffer reads
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.
Date: Fri May 16 12:10:56 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: [email protected]
The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb
Modid: xfs-linux-melb:xfs-kern:31173afs/xfs/linux-2.6/xfs_buf.h - 1.125 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.h.diff?r1=text&tr1=1.125&r2=text&tr2=1.124&f=h
- Reintroduce page locking for sub-blocksize buffer read synchronisation.
fs/xfs/linux-2.6/xfs_buf.c - 1.256 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.c.diff?r1=text&tr1=1.256&r2=text&tr2=1.255&f=h
- Reintroduce page locking for sub-blocksize buffer read synchronisation.