aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_file.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 30b553ac8f56..986448d1ff3c 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -1234,12 +1234,11 @@ xfs_file_release(
*/
if (inode->i_nlink &&
(file->f_mode & FMODE_WRITE) &&
+ !xfs_iflags_test(ip, XFS_EOFBLOCKS_RELEASED) &&
xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) {
if (xfs_can_free_eofblocks(ip) &&
- !xfs_iflags_test(ip, XFS_EOFBLOCKS_RELEASED)) {
+ !xfs_iflags_test_and_set(ip, XFS_EOFBLOCKS_RELEASED))
xfs_free_eofblocks(ip);
- xfs_iflags_set(ip, XFS_EOFBLOCKS_RELEASED);
- }
xfs_iunlock(ip, XFS_IOLOCK_EXCL);
}