Skip to content

Commit 988ef92

Browse files
Dave Chinnerdchinner
authored andcommitted
xfs: remove nonblocking mode from xfs_vm_writepage
Remove the nonblocking optimisation done for mapping lookups during writeback. It's not clear that leaving a hole in the writeback range just because we couldn't get a lock is really a win, as it makes us do another small random IO later on rather than a large sequential IO now. As this gets in the way of sane error handling later on, just remove for the moment and we can re-introduce an equivalent optimisation in future if we see problems due to extent map lock contention. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 36f90b0 commit 988ef92

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

fs/xfs/xfs_aops.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,7 @@ xfs_map_blocks(
283283
struct inode *inode,
284284
loff_t offset,
285285
struct xfs_bmbt_irec *imap,
286-
int type,
287-
int nonblocking)
286+
int type)
288287
{
289288
struct xfs_inode *ip = XFS_I(inode);
290289
struct xfs_mount *mp = ip->i_mount;
@@ -300,12 +299,7 @@ xfs_map_blocks(
300299
if (type == XFS_IO_UNWRITTEN)
301300
bmapi_flags |= XFS_BMAPI_IGSTATE;
302301

303-
if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) {
304-
if (nonblocking)
305-
return -EAGAIN;
306-
xfs_ilock(ip, XFS_ILOCK_SHARED);
307-
}
308-
302+
xfs_ilock(ip, XFS_ILOCK_SHARED);
309303
ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE ||
310304
(ip->i_df.if_flags & XFS_IFEXTENTS));
311305
ASSERT(offset <= mp->m_super->s_maxbytes);
@@ -955,7 +949,6 @@ xfs_vm_writepage(
955949
ssize_t len;
956950
int err, imap_valid = 0, uptodate = 1;
957951
int count = 0;
958-
int nonblocking = 0;
959952

960953
trace_xfs_writepage(inode, page, 0, 0);
961954

@@ -1055,9 +1048,6 @@ xfs_vm_writepage(
10551048
offset = page_offset(page);
10561049
type = XFS_IO_OVERWRITE;
10571050

1058-
if (wbc->sync_mode == WB_SYNC_NONE)
1059-
nonblocking = 1;
1060-
10611051
do {
10621052
int new_ioend = 0;
10631053

@@ -1117,8 +1107,7 @@ xfs_vm_writepage(
11171107
* time.
11181108
*/
11191109
new_ioend = 1;
1120-
err = xfs_map_blocks(inode, offset, &imap, type,
1121-
nonblocking);
1110+
err = xfs_map_blocks(inode, offset, &imap, type);
11221111
if (err)
11231112
goto error;
11241113
imap_valid = xfs_imap_valid(inode, &imap, offset);
@@ -1188,9 +1177,6 @@ xfs_vm_writepage(
11881177
if (iohead)
11891178
xfs_cancel_ioend(iohead);
11901179

1191-
if (err == -EAGAIN)
1192-
goto redirty;
1193-
11941180
xfs_aops_discard_page(page);
11951181
ClearPageUptodate(page);
11961182
unlock_page(page);

0 commit comments

Comments
 (0)