[LU-6628] ll_unlink() updates parent directory inode with victim timestamps Created: 21/May/15  Updated: 30/Jan/22

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0, Lustre 2.15.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: Emoly Liu
Resolution: Unresolved Votes: 0
Labels: llite, mdt

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   
# llmount.sh
...
# lctl set_param debug=+inode
debug=+inode
# cd /mnt/lustre
# mkdir d0
# lfs path2fid d0
[0x200000400:0x1:0x0]
# date +%s
1432234095
# date +%s --date='May 31 2015' # 10 days from now
1433048400
# touch --date=@1433048400 d0/f0
# stat d0/f0
  File: `d0/f0'
  Size: 0         	Blocks: 0          IO Block: 4194304 regular empty file
Device: 2c54f966h/743766374d	Inode: 144115205255725058  Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-05-31 00:00:00.000000000 -0500
Modify: 2015-05-31 00:00:00.000000000 -0500
Change: 2015-05-21 13:48:34.000000000 -0500
# lctl clear
# rm d0/f0
# lctl dk | grep ll_update_times
00000080:00000002:2.0:1432234174.052418:0:16832:0:(namei.c:902:ll_update_times()) setting fid [0x200000400:0x1:0x0] mtime from 1432234114 to 1433048400

Noe that the FID is that of the parent directory and the timestamp is 10 days from now.

When we stat the directory we get the right timestamps:

# stat d0
  File: `d0'
  Size: 4096      	Blocks: 8          IO Block: 4096   directory
Device: 2c54f966h/743766374d	Inode: 144115205255725057  Links: 2
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2015-05-21 13:47:31.000000000 -0500
Modify: 2015-05-21 13:49:34.000000000 -0500
Change: 2015-05-21 13:49:34.000000000 -0500

It appears the every use of ll_update_times() is incorrect. The attributes returned in the response body are for the child but are applied to the parent.

OTOH It's not clear why this function exists at all.


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