Skip to content

Commit 8272145

Browse files
committed
[XFS] Fix a writepage regression where we accidentally stopped honouring
nonblock mode with the new IO path code (since 2.6.16). SGI-PV: 951662 SGI-Modid: xfs-linux-melb:xfs-kern:25676a Signed-off-by: Nathan Scott <[email protected]>
1 parent e50bd16 commit 8272145

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

fs/xfs/linux-2.6/xfs_aops.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -870,12 +870,14 @@ xfs_page_state_convert(
870870
pgoff_t end_index, last_index, tlast;
871871
ssize_t size, len;
872872
int flags, err, iomap_valid = 0, uptodate = 1;
873-
int page_dirty, count = 0, trylock_flag = 0;
873+
int page_dirty, count = 0;
874+
int trylock = 0;
874875
int all_bh = unmapped;
875876

876-
/* wait for other IO threads? */
877-
if (startio && (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking))
878-
trylock_flag |= BMAPI_TRYLOCK;
877+
if (startio) {
878+
if (wbc->sync_mode == WB_SYNC_NONE && wbc->nonblocking)
879+
trylock |= BMAPI_TRYLOCK;
880+
}
879881

880882
/* Is this page beyond the end of the file? */
881883
offset = i_size_read(inode);
@@ -956,15 +958,13 @@ xfs_page_state_convert(
956958

957959
if (buffer_unwritten(bh)) {
958960
type = IOMAP_UNWRITTEN;
959-
flags = BMAPI_WRITE|BMAPI_IGNSTATE;
961+
flags = BMAPI_WRITE | BMAPI_IGNSTATE;
960962
} else if (buffer_delay(bh)) {
961963
type = IOMAP_DELAY;
962-
flags = BMAPI_ALLOCATE;
963-
if (!startio)
964-
flags |= trylock_flag;
964+
flags = BMAPI_ALLOCATE | trylock;
965965
} else {
966966
type = IOMAP_NEW;
967-
flags = BMAPI_WRITE|BMAPI_MMAP;
967+
flags = BMAPI_WRITE | BMAPI_MMAP;
968968
}
969969

970970
if (!iomap_valid) {

0 commit comments

Comments
 (0)