aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 691f61223ed6..23a7668e07da 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -1082,17 +1082,17 @@ xfs_vm_writepage(
1082 if (buffer_unwritten(bh) || buffer_delay(bh)) { 1082 if (buffer_unwritten(bh) || buffer_delay(bh)) {
1083 int new_ioend = 0; 1083 int new_ioend = 0;
1084 1084
1085 /*
1086 * Make sure we don't use a read-only iomap
1087 */
1088 if (flags == BMAPI_READ)
1089 imap_valid = 0;
1090
1091 if (buffer_unwritten(bh)) { 1085 if (buffer_unwritten(bh)) {
1092 type = IO_UNWRITTEN; 1086 if (type != IO_UNWRITTEN) {
1087 type = IO_UNWRITTEN;
1088 imap_valid = 0;
1089 }
1093 flags = BMAPI_WRITE | BMAPI_IGNSTATE; 1090 flags = BMAPI_WRITE | BMAPI_IGNSTATE;
1094 } else if (buffer_delay(bh)) { 1091 } else if (buffer_delay(bh)) {
1095 type = IO_DELAY; 1092 if (type != IO_DELAY) {
1093 type = IO_DELAY;
1094 imap_valid = 0;
1095 }
1096 flags = BMAPI_ALLOCATE; 1096 flags = BMAPI_ALLOCATE;
1097 1097
1098 if (wbc->sync_mode == WB_SYNC_NONE) 1098 if (wbc->sync_mode == WB_SYNC_NONE)
@@ -1128,8 +1128,11 @@ xfs_vm_writepage(
1128 * That means it must already have extents allocated 1128 * That means it must already have extents allocated
1129 * underneath it. Map the extent by reading it. 1129 * underneath it. Map the extent by reading it.
1130 */ 1130 */
1131 if (!imap_valid || flags != BMAPI_READ) { 1131 if (flags != BMAPI_READ) {
1132 flags = BMAPI_READ; 1132 flags = BMAPI_READ;
1133 imap_valid = 0;
1134 }
1135 if (!imap_valid) {
1133 size = xfs_probe_cluster(inode, page, bh, head); 1136 size = xfs_probe_cluster(inode, page, bh, head);
1134 err = xfs_map_blocks(inode, offset, size, 1137 err = xfs_map_blocks(inode, offset, size,
1135 &imap, flags); 1138 &imap, flags);