Skip to content

Commit ccb5889

Browse files
Lu Hongfeismfrench
authored andcommitted
ksmbd: Change the return value of ksmbd_vfs_query_maximal_access to void
The return value of ksmbd_vfs_query_maximal_access is meaningless, it is better to modify it to void. Signed-off-by: Lu Hongfei <[email protected]> Acked-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent cf5e7f7 commit ccb5889

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2872,11 +2872,9 @@ int smb2_open(struct ksmbd_work *work)
28722872
if (!file_present) {
28732873
daccess = cpu_to_le32(GENERIC_ALL_FLAGS);
28742874
} else {
2875-
rc = ksmbd_vfs_query_maximal_access(idmap,
2875+
ksmbd_vfs_query_maximal_access(idmap,
28762876
path.dentry,
28772877
&daccess);
2878-
if (rc)
2879-
goto err_out;
28802878
already_permitted = true;
28812879
}
28822880
maximal_access = daccess;

fs/smb/server/vfs.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,9 @@ static int ksmbd_vfs_path_lookup_locked(struct ksmbd_share_config *share_conf,
121121
return -ENOENT;
122122
}
123123

124-
int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,
124+
void ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,
125125
struct dentry *dentry, __le32 *daccess)
126126
{
127-
int ret = 0;
128-
129127
*daccess = cpu_to_le32(FILE_READ_ATTRIBUTES | READ_CONTROL);
130128

131129
if (!inode_permission(idmap, d_inode(dentry), MAY_OPEN | MAY_WRITE))
@@ -142,8 +140,6 @@ int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,
142140

143141
if (!inode_permission(idmap, d_inode(dentry->d_parent), MAY_EXEC | MAY_WRITE))
144142
*daccess |= FILE_DELETE_LE;
145-
146-
return ret;
147143
}
148144

149145
/**

fs/smb/server/vfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct ksmbd_kstat {
7272
};
7373

7474
int ksmbd_vfs_lock_parent(struct dentry *parent, struct dentry *child);
75-
int ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,
75+
void ksmbd_vfs_query_maximal_access(struct mnt_idmap *idmap,
7676
struct dentry *dentry, __le32 *daccess);
7777
int ksmbd_vfs_create(struct ksmbd_work *work, const char *name, umode_t mode);
7878
int ksmbd_vfs_mkdir(struct ksmbd_work *work, const char *name, umode_t mode);

0 commit comments

Comments
 (0)