Skip to content

Commit dc9c5bc

Browse files
djwongSomasundaram Krishnasamy
authored andcommitted
xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT
Benjamin Moody reported to Debian that XFS partially wedges when a chgrp fails on account of being out of disk quota. I ran his reproducer script: (and then as user dummy) $ dd if=/dev/urandom bs=1M count=50 of=/mnt/dummy/foo $ chgrp plugdev /mnt/dummy/foo and saw: ================================================ WARNING: lock held when returning to user space! 5.3.0-rc5 #rc5 Tainted: G W ------------------------------------------------ chgrp/47006 is leaving the kernel with locks still held! 1 lock held by chgrp/47006: #0: 000000006664ea2d (&xfs_nondir_ilock_class){++++}, at: xfs_ilock+0xd2/0x290 [xfs] ...which is clearly caused by xfs_setattr_nonsize failing to unlock the ILOCK after the xfs_qm_vop_chown_reserve call fails. Add the missing unlock. Reported-by: [email protected] Fixes: 253f491 ("xfs: better xfs_trans_alloc interface") Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Tested-by: Salvatore Bonaccorso <[email protected]> (cherry picked from commit 1fb254a) Orabug: 30902117 Signed-off-by: Junxiao Bi <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 11f4258 commit dc9c5bc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/xfs/xfs_iops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ xfs_setattr_nonsize(
787787

788788
out_cancel:
789789
xfs_trans_cancel(tp);
790+
xfs_iunlock(ip, XFS_ILOCK_EXCL);
790791
out_dqrele:
791792
xfs_qm_dqrele(udqp);
792793
xfs_qm_dqrele(gdqp);

0 commit comments

Comments
 (0)