[LU-10660] Truncate should revoke lease lock Created: 12/Feb/18  Updated: 18/Dec/18  Resolved: 16/Sep/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.11.0, Lustre 2.10.5
Fix Version/s: Lustre 2.12.0

Type: Improvement Priority: Critical
Reporter: Jinshan Xiong (Inactive) Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

Lustre lease lock is usually used to 'stabilize' file data so that it won't be accessed by any entities while certain operations are in progress. Open lock is used on the MDT side for this purpose.

However, truncate will change file data but it didn't revoke lease lock. We should grab mot_open_sem and check mot_lease_count to see if there exists any pending lease on the file. If lease exists, it should be broken.



 Comments   
Comment by Peter Jones [ 24/Jul/18 ]

Jian

Could you please investigate this issue?

Thanks

Peter

Comment by Andreas Dilger [ 24/Jul/18 ]

Jinshan, is this a case where FLR resync could cause a bad replica to be created, and essentially lead to data corruption?

Comment by Jinshan Xiong [ 25/Jul/18 ]

Yes, and this would break any programs that uses lease lock for data exclusive access. 

Comment by Gerrit Updater [ 30/Aug/18 ]

Jian Yu (yujian@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33093
Subject: LU-10660 mdt: revoke lease lock for truncate
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: cd1d8cb22eaafb671e3af3f22651bdbd74721a65

Comment by Gerrit Updater [ 16/Sep/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33093/
Subject: LU-10660 mdt: revoke lease lock for truncate
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: e4c168165df201f8800118a4913bbb02e0bad3c1

Comment by Jian Yu [ 16/Sep/18 ]

Patch landed to master branch for Lustre 2.12.0.

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