Commit 823d0d3e authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: remove generic_fillattr use in smb2_open()

Removed the use of unneeded generic_fillattr() in smb2_open().
Reviewed-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent c22180a5
...@@ -2761,7 +2761,6 @@ int smb2_open(struct ksmbd_work *work) ...@@ -2761,7 +2761,6 @@ int smb2_open(struct ksmbd_work *work)
} else { } else {
file_present = true; file_present = true;
user_ns = mnt_user_ns(path.mnt); user_ns = mnt_user_ns(path.mnt);
generic_fillattr(user_ns, d_inode(path.dentry), &stat);
} }
if (stream_name) { if (stream_name) {
if (req->CreateOptions & FILE_DIRECTORY_FILE_LE) { if (req->CreateOptions & FILE_DIRECTORY_FILE_LE) {
...@@ -2770,7 +2769,8 @@ int smb2_open(struct ksmbd_work *work) ...@@ -2770,7 +2769,8 @@ int smb2_open(struct ksmbd_work *work)
rsp->hdr.Status = STATUS_NOT_A_DIRECTORY; rsp->hdr.Status = STATUS_NOT_A_DIRECTORY;
} }
} else { } else {
if (S_ISDIR(stat.mode) && s_type == DATA_STREAM) { if (file_present && S_ISDIR(d_inode(path.dentry)->i_mode) &&
s_type == DATA_STREAM) {
rc = -EIO; rc = -EIO;
rsp->hdr.Status = STATUS_FILE_IS_A_DIRECTORY; rsp->hdr.Status = STATUS_FILE_IS_A_DIRECTORY;
} }
...@@ -2787,7 +2787,8 @@ int smb2_open(struct ksmbd_work *work) ...@@ -2787,7 +2787,8 @@ int smb2_open(struct ksmbd_work *work)
} }
if (file_present && req->CreateOptions & FILE_NON_DIRECTORY_FILE_LE && if (file_present && req->CreateOptions & FILE_NON_DIRECTORY_FILE_LE &&
S_ISDIR(stat.mode) && !(req->CreateOptions & FILE_DELETE_ON_CLOSE_LE)) { S_ISDIR(d_inode(path.dentry)->i_mode) &&
!(req->CreateOptions & FILE_DELETE_ON_CLOSE_LE)) {
ksmbd_debug(SMB, "open() argument is a directory: %s, %x\n", ksmbd_debug(SMB, "open() argument is a directory: %s, %x\n",
name, req->CreateOptions); name, req->CreateOptions);
rsp->hdr.Status = STATUS_FILE_IS_A_DIRECTORY; rsp->hdr.Status = STATUS_FILE_IS_A_DIRECTORY;
...@@ -2797,7 +2798,7 @@ int smb2_open(struct ksmbd_work *work) ...@@ -2797,7 +2798,7 @@ int smb2_open(struct ksmbd_work *work)
if (file_present && (req->CreateOptions & FILE_DIRECTORY_FILE_LE) && if (file_present && (req->CreateOptions & FILE_DIRECTORY_FILE_LE) &&
!(req->CreateDisposition == FILE_CREATE_LE) && !(req->CreateDisposition == FILE_CREATE_LE) &&
!S_ISDIR(stat.mode)) { !S_ISDIR(d_inode(path.dentry)->i_mode)) {
rsp->hdr.Status = STATUS_NOT_A_DIRECTORY; rsp->hdr.Status = STATUS_NOT_A_DIRECTORY;
rc = -EIO; rc = -EIO;
goto err_out; goto err_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment