Skip to content

Commit b8e516b

Browse files
committed
Merge tag '5.8-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Eight cifs/smb3 fixes, most when specifying the multiuser mount flag. Five of the fixes are for stable" * tag '5.8-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: prevent truncation from long to int in wait_for_free_credits cifs: Fix the target file was deleted when rename failed. SMB3: Honor 'posix' flag for multiuser mounts SMB3: Honor 'handletimeout' flag for multiuser mounts SMB3: Honor lease disabling for multiuser mounts SMB3: Honor persistent/resilient handle flags for multiuser mounts SMB3: Honor 'seal' flag for multiuser mounts cifs: Display local UID details for SMB sessions in DebugData
2 parents 6f21671 + 19e8886 commit b8e516b

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

fs/cifs/cifs_debug.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,18 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
399399
if (ses->sign)
400400
seq_puts(m, " signed");
401401

402+
seq_printf(m, "\n\tUser: %d Cred User: %d",
403+
from_kuid(&init_user_ns, ses->linux_uid),
404+
from_kuid(&init_user_ns, ses->cred_uid));
405+
402406
if (ses->chan_count > 1) {
403407
seq_printf(m, "\n\n\tExtra Channels: %zu\n",
404408
ses->chan_count-1);
405409
for (j = 1; j < ses->chan_count; j++)
406410
cifs_dump_channel(m, j, &ses->chans[j]);
407411
}
408412

409-
seq_puts(m, "\n\tShares:");
413+
seq_puts(m, "\n\n\tShares:");
410414
j = 0;
411415

412416
seq_printf(m, "\n\t%d) IPC: ", j);

fs/cifs/connect.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5306,9 +5306,15 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
53065306
vol_info->nocase = master_tcon->nocase;
53075307
vol_info->nohandlecache = master_tcon->nohandlecache;
53085308
vol_info->local_lease = master_tcon->local_lease;
5309+
vol_info->no_lease = master_tcon->no_lease;
5310+
vol_info->resilient = master_tcon->use_resilient;
5311+
vol_info->persistent = master_tcon->use_persistent;
5312+
vol_info->handle_timeout = master_tcon->handle_timeout;
53095313
vol_info->no_linux_ext = !master_tcon->unix_ext;
5314+
vol_info->linux_ext = master_tcon->posix_extensions;
53105315
vol_info->sectype = master_tcon->ses->sectype;
53115316
vol_info->sign = master_tcon->ses->sign;
5317+
vol_info->seal = master_tcon->seal;
53125318

53135319
rc = cifs_set_vol_auth(vol_info, master_tcon->ses);
53145320
if (rc) {
@@ -5334,10 +5340,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
53345340
goto out;
53355341
}
53365342

5337-
/* if new SMB3.11 POSIX extensions are supported do not remap / and \ */
5338-
if (tcon->posix_extensions)
5339-
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS;
5340-
53415343
if (cap_unix(ses))
53425344
reset_cifs_unix_caps(0, tcon, NULL, vol_info);
53435345

fs/cifs/inode.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
20442044
FILE_UNIX_BASIC_INFO *info_buf_target;
20452045
unsigned int xid;
20462046
int rc, tmprc;
2047+
bool new_target = d_really_is_negative(target_dentry);
20472048

20482049
if (flags & ~RENAME_NOREPLACE)
20492050
return -EINVAL;
@@ -2120,8 +2121,13 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
21202121
*/
21212122

21222123
unlink_target:
2123-
/* Try unlinking the target dentry if it's not negative */
2124-
if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) {
2124+
/*
2125+
* If the target dentry was created during the rename, try
2126+
* unlinking it if it's not negative
2127+
*/
2128+
if (new_target &&
2129+
d_really_is_positive(target_dentry) &&
2130+
(rc == -EACCES || rc == -EEXIST)) {
21252131
if (d_is_dir(target_dentry))
21262132
tmprc = cifs_rmdir(target_dir, target_dentry);
21272133
else

fs/cifs/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits,
523523
const int timeout, const int flags,
524524
unsigned int *instance)
525525
{
526-
int rc;
526+
long rc;
527527
int *credits;
528528
int optype;
529529
long int t;

0 commit comments

Comments
 (0)