linux/fs/xfs
Darrick J. Wong 1fb254aa98 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:

# adduser dummy
# adduser dummy plugdev

# dd if=/dev/zero bs=1M count=100 of=test.img
# mkfs.xfs test.img
# mount -t xfs -o gquota test.img /mnt
# mkdir -p /mnt/dummy
# chown -c dummy /mnt/dummy
# xfs_quota -xc 'limit -g bsoft=100k bhard=100k plugdev' /mnt

(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: benjamin.moody@gmail.com
Fixes: 253f4911f2 ("xfs: better xfs_trans_alloc interface")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Salvatore Bonaccorso <carnil@debian.org>
2019-08-22 20:55:54 -07:00
..
libxfs xfs: don't crash on null attr fork xfs_bmapi_read 2019-08-12 09:32:44 -07:00
scrub xfs: Fix possible null-pointer dereferences in xchk_da_btree_block_check_sibling() 2019-07-30 11:28:20 -07:00
Kconfig
kmem.c
kmem.h
Makefile xfs: move xfs_trans_inode.c to libxfs/ 2019-07-15 08:10:18 -07:00
mrlock.h
xfs.h
xfs_acl.c
xfs_acl.h
xfs_aops.c for-linus-20190715 2019-07-15 21:20:52 -07:00
xfs_aops.h
xfs_attr_inactive.c
xfs_attr_list.c
xfs_bio_io.c xfs: chain bios the right way around in xfs_rw_bdev 2019-07-10 10:04:16 -07:00
xfs_bmap_item.c
xfs_bmap_item.h
xfs_bmap_util.c
xfs_bmap_util.h
xfs_buf.c
xfs_buf.h
xfs_buf_item.c
xfs_buf_item.h
xfs_dir2_readdir.c
xfs_discard.c
xfs_discard.h
xfs_dquot.c xfs: create iterator error codes 2019-07-02 09:40:05 -07:00
xfs_dquot.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_error.c
xfs_error.h
xfs_export.c
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c - virtio_pmem: The new virtio_pmem facility introduces a paravirtualized 2019-07-18 10:52:08 -07:00
xfs_filestream.c
xfs_filestream.h
xfs_fsmap.c
xfs_fsmap.h
xfs_fsops.c
xfs_fsops.h
xfs_globals.c xfs: multithreaded iwalk implementation 2019-07-03 07:33:26 -07:00
xfs_health.c xfs: introduce new v5 bulkstat structure 2019-07-03 20:36:26 -07:00
xfs_icache.c
xfs_icache.h
xfs_icreate_item.c
xfs_icreate_item.h
xfs_inode.c
xfs_inode.h
xfs_inode_item.c
xfs_inode_item.h
xfs_ioctl.c New stuff for 5.3: 2019-07-12 17:17:51 -07:00
xfs_ioctl.h xfs: introduce v5 inode group structure 2019-07-03 20:36:27 -07:00
xfs_ioctl32.c xfs: compat_ioctl: use compat_ptr() 2019-08-16 18:42:59 -07:00
xfs_ioctl32.h xfs: remove various bulk request typedef usage 2019-07-03 20:36:25 -07:00
xfs_iomap.c
xfs_iomap.h
xfs_iops.c xfs: fix missing ILOCK unlock when xfs_setattr_nonsize fails due to EDQUOT 2019-08-22 20:55:54 -07:00
xfs_iops.h
xfs_itable.c xfs: fix stack contents leakage in the v1 inumber ioctls 2019-07-28 21:12:32 -07:00
xfs_itable.h xfs: specify AG in bulk req 2019-07-04 07:52:23 -07:00
xfs_iwalk.c xfs: specify AG in bulk req 2019-07-04 07:52:23 -07:00
xfs_iwalk.h xfs: specify AG in bulk req 2019-07-04 07:52:23 -07:00
xfs_linux.h
xfs_log.c fs: xfs: xfs_log: Don't use KM_MAYFAIL at xfs_log_reserve(). 2019-08-03 09:36:43 -07:00
xfs_log.h fs: xfs: xfs_log: Change return type from int to void 2019-07-03 08:21:58 -07:00
xfs_log_cil.c
xfs_log_priv.h fs: xfs: xfs_log: Change return type from int to void 2019-07-03 08:21:58 -07:00
xfs_log_recover.c fs: xfs: xfs_log: Change return type from int to void 2019-07-03 08:21:58 -07:00
xfs_message.c
xfs_message.h
xfs_mount.c
xfs_mount.h
xfs_mru_cache.c
xfs_mru_cache.h
xfs_ondisk.h xfs: wire up the v5 inumbers ioctl 2019-07-03 20:36:28 -07:00
xfs_pnfs.c fs/xfs: Fix return code of xfs_break_leased_layouts() 2019-08-19 18:15:28 -07:00
xfs_pnfs.h
xfs_pwork.c xfs: poll waiting for quotacheck 2019-07-03 08:21:58 -07:00
xfs_pwork.h xfs: poll waiting for quotacheck 2019-07-03 08:21:58 -07:00
xfs_qm.c xfs: specify AG in bulk req 2019-07-04 07:52:23 -07:00
xfs_qm.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_quota.h
xfs_quotaops.c
xfs_refcount_item.c
xfs_refcount_item.h
xfs_reflink.c xfs: fix reflink source file racing with directio writes 2019-08-18 18:53:25 -07:00
xfs_reflink.h
xfs_rmap_item.c
xfs_rmap_item.h
xfs_rtalloc.c
xfs_rtalloc.h
xfs_stats.c
xfs_stats.h
xfs_super.c
xfs_super.h
xfs_symlink.c
xfs_symlink.h
xfs_sysctl.c
xfs_sysctl.h xfs: multithreaded iwalk implementation 2019-07-03 07:33:26 -07:00
xfs_sysfs.c xfs: multithreaded iwalk implementation 2019-07-03 07:33:26 -07:00
xfs_sysfs.h
xfs_trace.c
xfs_trace.h xfs: multithreaded iwalk implementation 2019-07-03 07:33:26 -07:00
xfs_trans.c
xfs_trans.h
xfs_trans_ail.c
xfs_trans_buf.c
xfs_trans_dquot.c
xfs_trans_priv.h
xfs_xattr.c