[LU-11631] symlink migration should not create remote inodes Created: 06/Nov/18  Updated: 21/Nov/20  Resolved: 29/Oct/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0, Lustre 2.13.0, Lustre 2.10.6
Fix Version/s: Lustre 2.14.0

Type: Improvement Priority: Major
Reporter: Andreas Dilger Assignee: Lai Siyao
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
is related to LU-11872 Request for option not to follow syml... Resolved
is related to LU-11130 cross-target rename creates invalid s... Resolved
Rank (Obsolete): 9223372036854775807

 Description   

Migrating a symlink should not leave a remote agent inode on the original MDT in the extremely common case where there is not a hardlink to the symlink (apparently that is possible under POSIX and Linux allows it, who knew?):

touch tt
$ ln -s tt tt.link
$ ln -n tt.link tt.nlink
$ ls -li tt*
408143 0 -rw-rw-r-- 1 mythtv  mythtv    0 Nov  6 13:02 tt
408146 0 lrwxrwxrwx 2 mythtv  mythtv    2 Nov  6 13:02 tt.hlink -> tt
408146 0 lrwxrwxrwx 2 mythtv  mythtv    2 Nov  6 13:02 tt.link -> tt

Since we can never hold symlinks open and they can never be modified in place (except for renaming them) there is no danger to move the whole symlink to the new MDT during rename instead of leaving a stub agent inode on the original MDT, except in the rare case where the link count > 1.



 Comments   
Comment by Andreas Dilger [ 21/Mar/20 ]

Zam, any chance you could take a look at implementing this for 2.14?

Comment by Andreas Dilger [ 24/Apr/20 ]

Lai, now that the directory split patches are starting to land, would you have time to look at this?

This would also help avoid the creation of remote symlinks after creating and renaming temporary symlink files to change their project ID in LU-11872.

Comment by Lai Siyao [ 26/Apr/20 ]

Okay, I'll work on it soon.

Comment by Gerrit Updater [ 14/Sep/20 ]

Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39896
Subject: LU-11631 obdclass: nlink is not set in struct obdo
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 950c7dfb6b99c357a0520c42a8ad0c2762577745

Comment by Gerrit Updater [ 14/Sep/20 ]

Lai Siyao (lai.siyao@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39897
Subject: LU-11631 mdd: migrate symlink if rename is between MDTs
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: fd3cbfc62cfe84c1ed6beadc2933e67e6d1c7464

Comment by Gerrit Updater [ 25/Sep/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39896/
Subject: LU-11631 obdclass: nlink is not set in struct obdo
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: a9ba4bca528938bf24ec1b172e03b24808393fb2

Comment by Gerrit Updater [ 29/Oct/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39897/
Subject: LU-11631 mdd: migrate symlink for cross-MDT rename
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9adc02c016d2c0c1211274cb407637f9b49b4e09

Comment by Peter Jones [ 29/Oct/20 ]

Landed for 2.14

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