Whamcloud - gitweb
LU-10660 mdt: revoke lease lock for truncate 93/33093/6
authorJian Yu <yujian@whamcloud.com>
Mon, 10 Sep 2018 05:10:30 +0000 (22:10 -0700)
committerOleg Drokin <green@whamcloud.com>
Sun, 16 Sep 2018 06:41:42 +0000 (06:41 +0000)
commite4c168165df201f8800118a4913bbb02e0bad3c1
treece252269f9bc9904eba139a5b01d688c16d6b2d3
parente39a323bdcdec48d0fc246a366de973790748c4d
LU-10660 mdt: revoke lease lock for truncate

Lustre lease lock is usually used to protect file data
against concurrent access. Open lock used on MDT side
is for this purpose. However, truncate will change
file data but it doesn't revoke lease lock.

This patch fixes the issue by acquiring open sem,
checking lease count and revoking lease if there exists
any pending lease on the file.

Change-Id: Ia55457c6d7e1e76f98b41feef39577822304513b
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/33093
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/llite/llite_lib.c
lustre/mdt/mdt_lib.c
lustre/mdt/mdt_reint.c