Skip to content

xfs: eofblocks serialization fixes

Brian Foster linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 3 repliesIn review

Changes in v2 from the cover letter

- Kill off the xfs_free_eofblocks() need_iolock parameter. All callers must acquire IOLOCK_EXCL.
- Drop iolock across internal low free space scans to avoid livelock.
v1: http://www.spinics.net/lists/linux-xfs/msg03437.html

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3xfs: pull up iolock from xfs_free_eofblocks()fs/xfs/xfs_bmap_util.c fs/xfs/xfs_bmap_util.h fs/xfs/xfs_icache.c +1 more+60 -591 reply
2/3xfs: sync eofblocks scans under iolock are livelock pronefs/xfs/xfs_file.c fs/xfs/xfs_icache.c fs/xfs/xfs_icache.h+16 -441 reply
3/3xfs: fix eofblocks race with file extending async dio writesfs/xfs/xfs_bmap_util.c+3 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchChristoph Hellwig
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] xfs: eofblocks serialization fixes

Hi all,

Here is v2 of the xfs_free_eofblocks() i_size fix. Patch 1 is new and kills off the need_iolock parameter as suggested by Christoph. Patch 2 is also new and fixes a separate bug I ran into during testing where multiple threads crash into ENOSPC, run eofb scans in parallel and livelock against eachother because inode iolocks are held across entire eofb scans. Patch 3 is roughly the same as v1: serialize xfs_free_eofblocks() against file-extending async dio writes via inode_dio_wait().

Thoughts, reviews, flames appreciated.

Brian

v2:
- Kill off the xfs_free_eofblocks() need_iolock parameter. All callers must acquire IOLOCK_EXCL.
- Drop iolock across internal low free space scans to avoid livelock.
v1: http://www.spinics.net/lists/linux-xfs/msg03437.html

Brian Foster (3):
xfs: pull up iolock from xfs_free_eofblocks()
xfs: sync eofblocks scans under iolock are livelock prone
xfs: fix eofblocks race with file extending async dio writes

 fs/xfs/xfs_bmap_util.c | 42 +++++++++++++++--------------------
 fs/xfs/xfs_bmap_util.h |  3 +--
 fs/xfs/xfs_file.c      | 13 +++++++----
 fs/xfs/xfs_icache.c    | 59 +++++++++++++++-----------------------------------
 fs/xfs/xfs_icache.h    |  2 --
 fs/xfs/xfs_inode.c     | 51 +++++++++++++++++++++++--------------------
 6 files changed, 73 insertions(+), 97 deletions(-)
Signature · 1 line
2.7.4