Skip to content

Commit f433283

Browse files
namjaejeonSteve French
authored andcommitted
ksmbd: not allow to open file if delelete on close bit is set
Cthon test fail with the following error. check for proper open/unlink operation nfsjunk files before unlink: -rwxr-xr-x 1 root root 0 9월 25 11:03 ./nfs2y8Jm9 ./nfs2y8Jm9 open; unlink ret = 0 nfsjunk files after unlink: -rwxr-xr-x 1 root root 0 9월 25 11:03 ./nfs2y8Jm9 data compare ok nfsjunk files after close: ls: cannot access './nfs2y8Jm9': No such file or directory special tests failed Cthon expect to second unlink failure when file is already unlinked. ksmbd can not allow to open file if flags of ksmbd inode is set with S_DEL_ON_CLS flags. Cc: stable@vger.kernel.org Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 94f6f05 commit f433283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/smb/server/vfs_cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int ksmbd_query_inode_status(struct inode *inode)
106106
ci = __ksmbd_inode_lookup(inode);
107107
if (ci) {
108108
ret = KSMBD_INODE_STATUS_OK;
109-
if (ci->m_flags & S_DEL_PENDING)
109+
if (ci->m_flags & (S_DEL_PENDING | S_DEL_ON_CLS))
110110
ret = KSMBD_INODE_STATUS_PENDING_DELETE;
111111
atomic_dec(&ci->m_count);
112112
}
@@ -116,7 +116,7 @@ int ksmbd_query_inode_status(struct inode *inode)
116116

117117
bool ksmbd_inode_pending_delete(struct ksmbd_file *fp)
118118
{
119-
return (fp->f_ci->m_flags & S_DEL_PENDING);
119+
return (fp->f_ci->m_flags & (S_DEL_PENDING | S_DEL_ON_CLS));
120120
}
121121

122122
void ksmbd_set_inode_pending_delete(struct ksmbd_file *fp)

0 commit comments

Comments
 (0)