Skip to content

Commit cd60773

Browse files
committed
Merge tag '5.6-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Three small smb3 fixes, two for stable" * tag '5.6-rc6-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: CIFS: fiemap: do not return EINVAL if get nothing CIFS: Increment num_remote_opens stats counter even in case of smb2_query_dir_first cifs: potential unintitliazed error code in cifs_getattr()
2 parents 207f75c + 979a266 commit cd60773

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

fs/cifs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,7 @@ int cifs_getattr(const struct path *path, struct kstat *stat,
21912191
if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID))
21922192
stat->gid = current_fsgid();
21932193
}
2194-
return rc;
2194+
return 0;
21952195
}
21962196

21972197
int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start,

fs/cifs/smb2ops.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,6 +2222,8 @@ smb2_query_dir_first(const unsigned int xid, struct cifs_tcon *tcon,
22222222
goto qdf_free;
22232223
}
22242224

2225+
atomic_inc(&tcon->num_remote_opens);
2226+
22252227
qd_rsp = (struct smb2_query_directory_rsp *)rsp_iov[1].iov_base;
22262228
if (qd_rsp->sync_hdr.Status == STATUS_NO_MORE_FILES) {
22272229
trace_smb3_query_dir_done(xid, fid->persistent_fid,
@@ -3417,7 +3419,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon,
34173419
if (rc)
34183420
goto out;
34193421

3420-
if (out_data_len < sizeof(struct file_allocated_range_buffer)) {
3422+
if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) {
34213423
rc = -EINVAL;
34223424
goto out;
34233425
}

0 commit comments

Comments
 (0)