[LU-5456] ll_hsm_import() calls ll_setattr_raw() without holding i_mutex Created: 06/Aug/14  Updated: 14/Aug/14  Resolved: 14/Aug/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.7.0, Lustre 2.5.3
Fix Version/s: Lustre 2.7.0, Lustre 2.5.3

Type: Bug Priority: Critical
Reporter: John Hammond Assignee: John Hammond
Resolution: Fixed Votes: 0
Labels: hsm

Severity: 3
Rank (Obsolete): 15196

 Description   

ll_hsm_import() calls ll_setattr_raw() without holding the inode mutex but when called on a non-directory ll_setattr_raw() will unlock and relock the inode. For whatever reason a spurious unlock followed by a lock doesn't restore the balance of the universe. To see this observe that the following rm will hang in vfs_unlink() trying the lock the inode mutex:

# echo XXX > /tmp/hsm_root/f0
# lhsmtool_posix --archive=0 --hsm-root=/tmp/hsm_root/ --import f0 /mnt/lustre/f0 /mnt/lustre
lhsmtool_posix[4833]: action=1 src=f0 dst=/mnt/lustre/f0 mount_point=/mnt/lustre
lhsmtool_posix[4833]: importing '/mnt/lustre/f0' from '/tmp/hsm_root//f0'
lhsmtool_posix[4833]: imported '/mnt/lustre/f0' from '/tmp/hsm_root//0002/0000/0400/8000/0002/0000/0x280000400:0x2:0x0'=='/tmp/hsm_root//f0'
lhsmtool_posix[4833]: process finished, errs: 0 major, 0 minor, rc=0 (Success)
# rm /mnt/lustre/f0



 Comments   
Comment by John Hammond [ 06/Aug/14 ]

Please see http://review.whamcloud.com/11349.

Comment by Peter Jones [ 14/Aug/14 ]

Landed for 2.5.3 and 2.7

Generated at Sat Feb 10 01:51:38 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.