Whamcloud - gitweb
LU-18860 mdd: fix CLF_UNLINK_LAST on open file unlink 78/58578/4
authorEtienne AUJAMES <etienne.aujames@cea.fr>
Fri, 28 Mar 2025 17:57:11 +0000 (18:57 +0100)
committerOleg Drokin <green@whamcloud.com>
Wed, 16 Apr 2025 20:44:05 +0000 (20:44 +0000)
commit67c0c58800d6ca2fc71578c9be415b4d0a774c5a
tree7dd8b76becd08df937ec5acd85542b55b6e15ab5
parent7fafc105a1a236752b1ec1e0f61ff8c325680af4
LU-18860 mdd: fix CLF_UNLINK_LAST on open file unlink

The flag CLF_UNLINK_LAST should be set for UNLINK changelog if the
last link is removed.

This flag is not set if the file is open on a client.
If the file open, Lustre will re-link the file in the PENDING
MDT directory. So, la_nlink == 1 after mdd_finish_unlink() and
CLF_UNLINK_LAST will not be set.

Check if the object is dead instead of relying on la_nlink to set the
flag.

Update the sanity 161c for that use case.

Test-Parameters: testlist=sanity env=ONLY=161c,ONLY_REPEAT=20
Test-Parameters: testlist=sanity env=ONLY=161
Signed-off-by: Etienne AUJAMES <eaujames@ddn.com>
Change-Id: I35ef530cd55cd5e07ad79a7cdae056de95735f61
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/58578
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Qian Yingjin <qian@ddn.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdd/mdd_dir.c
lustre/tests/sanity.sh