Skip to contentSkip to conversation

PARTIAL TAKE 960328 - Garbage found in a preallocated file on XFS

DISCUSSION David Chinner 1 participant 1 message Jan 30, 2007

lore
Share & tools
lore
#0 lore raw

Fix sub-block zeroing for buffered writes into unwritten extents.

When writing less than a filesystem block of data into an unwritten extent via buffered I/O, __xfs_get_blocks fails to set the buffer new flag. As a result, the generic code will not zero either edge of the block resulting in garbage being written to disk either side of the real data. Set the buffer new state on bufferd writes to unwritten extents to ensure that zeroing occurs.

Date:  Tue Jan 30 11:57:42 AEDT 2007
Workarea:  chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs
Inspected by:  lachlan

The following file(s) were checked into:
longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb

Modid: xfs-linux-melb:xfs-kern:28000a fs/xfs/linux-2.6/xfs_aops.c - 1.140 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_aops.c.diff?r1=text&tr1=1.140&r2=text&tr2=1.139&f=h
- Set the buffer_new state when writing into unwritten extents so that sub-block zeroing will occur for buffered writes if necessary.