Commit a5c4ca27 authored by Nathan Scott's avatar Nathan Scott

[XFS] Ensure buffers that map to unwritten extents are only submitted

when properly setup.

SGI Modid: xfs-linux:xfs-kern:173555a
Signed-off-by: nathans@sgi.com
parent ab96a934
...@@ -288,7 +288,7 @@ xfs_probe_unwritten_page( ...@@ -288,7 +288,7 @@ xfs_probe_unwritten_page(
*fsbs = 0; *fsbs = 0;
bh = head = page_buffers(page); bh = head = page_buffers(page);
do { do {
if (!buffer_unwritten(bh)) if (!buffer_unwritten(bh) || !buffer_uptodate(bh))
break; break;
if (!xfs_offset_to_map(page, iomapp, p_offset)) if (!xfs_offset_to_map(page, iomapp, p_offset))
break; break;
...@@ -769,6 +769,8 @@ xfs_page_state_convert( ...@@ -769,6 +769,8 @@ xfs_page_state_convert(
* extent state conversion transaction on completion. * extent state conversion transaction on completion.
*/ */
if (buffer_unwritten(bh)) { if (buffer_unwritten(bh)) {
if (!startio)
continue;
if (!iomp) { if (!iomp) {
err = xfs_map_blocks(inode, offset, len, &iomap, err = xfs_map_blocks(inode, offset, len, &iomap,
BMAPI_READ|BMAPI_IGNSTATE); BMAPI_READ|BMAPI_IGNSTATE);
...@@ -778,7 +780,7 @@ xfs_page_state_convert( ...@@ -778,7 +780,7 @@ xfs_page_state_convert(
iomp = xfs_offset_to_map(page, &iomap, iomp = xfs_offset_to_map(page, &iomap,
p_offset); p_offset);
} }
if (iomp && startio) { if (iomp) {
if (!bh->b_end_io) { if (!bh->b_end_io) {
err = xfs_map_unwritten(inode, page, err = xfs_map_unwritten(inode, page,
head, bh, p_offset, head, bh, p_offset,
...@@ -787,7 +789,10 @@ xfs_page_state_convert( ...@@ -787,7 +789,10 @@ xfs_page_state_convert(
if (err) { if (err) {
goto error; goto error;
} }
} else {
set_bit(BH_Lock, &bh->b_state);
} }
BUG_ON(!buffer_locked(bh));
bh_arr[cnt++] = bh; bh_arr[cnt++] = bh;
page_dirty = 0; page_dirty = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment