xfs: prevent close() hangs on frozen filesystems
Status from this message: Applied to for-next, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest posting 2/21 patch 3 repliesApplied
- v6 posting 1/20 of 1 patch 0 repliesSuperseded
- v2 posting 3/32 patches 2 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 posting 2/3 | 2 patches | 2 replies | Superseded | |
| v2 posting 1/3 | 1 patch | 2 replies | Superseded | |
| v1 | 1 patch | 1 reply | Superseded |
Patches in v6 posting 2/2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/1 | xfs: prevent close() from hanging on frozen filesystemsfs/ | +13 | 2 replies |
Reviews trailers per patch
The patch has a Reviewed-by or Acked-by.
| Patch | Darrick J. Wong | Christoph Hellwig |
|---|---|---|
| 1/1 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v6 0/1] xfs: prevent close() hangs on frozen filesystems
Hi Christoph, Darrick, and Carlos,
This is version 6 of the patch series addressing the close() system call hanging indefinitely on frozen XFS filesystems (Bugzilla #205833).
In v5, I introduced a transaction allocation flag (XFS_TRANS_WRITECOUNT_TRYLOCK) to handle the trylock inside __xfs_trans_alloc() and propagated it down to xfs_free_eofblocks(). Christoph suggested this design and reviewed the implementation.
However, Darrick suggested that the deadlock can be resolved much more simply at the VFS-layer within xfs_file_release() by surrounding the existing check with sb_start_write_trylock() instead of passing transaction allocation flags all the way down.
This v6 implements that VFS-layer trylock approach. It modifies only a single file (fs/xfs/xfs_file.c). If sb_start_write_trylock() fails (meaning the filesystem is frozen or freezing), we simply skip the speculative preallocation trim.
I would appreciate your guidance on which of the two architectural paths is preferred for XFS:
1. The v5 transaction-flag approach (centralized within xfs_trans_alloc).
2. The v6 VFS-level trylock approach (localized within xfs_file_release).
If the v5 approach is preferred, I will rebase the transaction-flag patches onto the current master and submit them as a new version.
Thanks,
Aditya
Aditya Prakash Srivastava (1):
xfs: prevent close() from hanging on frozen filesystems
fs/xfs/xfs_file.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
Signature · 1 line
2.47.3