}
mutex_unlock(&lli->lli_och_mutex);
- if (!md_lock_match(ll_i2mdexp(inode), flags, ll_inode2fid(inode),
+ /* LU-4398: do not cache write open lock if the file has exec bit */
+ if ((lockmode == LCK_CW && inode->i_mode & S_IXUGO) ||
+ !md_lock_match(ll_i2mdexp(inode), flags, ll_inode2fid(inode),
LDLM_IBITS, &policy, lockmode, &lockh))
rc = ll_md_real_close(inode, fd->fd_omode);
if [[ $(uname -m) = aarch64 ]]; then
# bug number: LU-11596
ALWAYS_EXCEPT+=" $GRANT_CHECK_LIST"
- # bug number: LU-11671 LU-11594 LU-11667 LU-11729
- ALWAYS_EXCEPT+=" 45 103a 317 810"
+ # bug number: LU-11671 LU-11594 LU-11667 LU-11729 LU-4398
+ ALWAYS_EXCEPT+=" 45 103a 317 810 817"
fi
# 5 12 (min)"
}
run_test 816 "do not reset lru_resize on idle reconnect"
+cleanup_817() {
+ umount $tmpdir
+ exportfs -u localhost:$DIR/nfsexp
+ rm -rf $DIR/nfsexp
+}
+
+test_817() {
+ systemctl restart nfs-server.service || skip "failed to restart nfsd"
+
+ mkdir -p $DIR/nfsexp
+ exportfs -orw,no_root_squash localhost:$DIR/nfsexp ||
+ error "failed to export nfs"
+
+ tmpdir=$(mktemp -d /tmp/nfs-XXXXXX)
+ stack_trap cleanup_817 EXIT
+
+ mount -t nfs -orw localhost:$DIR/nfsexp $tmpdir ||
+ error "failed to mount nfs to $tmpdir"
+
+ cp /bin/true $tmpdir
+ $DIR/nfsexp/true || error "failed to execute 'true' command"
+}
+run_test 817 "nfsd won't cache write lock for exec file"
+
#
# tests that do cleanup/setup should be run at the end
#