Skip to content

Commit fd88f14

Browse files
committed
Merge tag '6.4-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs client fixes from Steve French: - fix for copy_file_range bug for very large files that are multiples of rsize - do not ignore "isolated transport" flag if set on share - set rasize default better - three fixes related to shutdown and freezing (fixes 4 xfstests, and closes deferred handles faster in some places that were missed) * tag '6.4-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: release leases for deferred close handles when freezing smb3: fix problem remounting a share after shutdown SMB3: force unmount was failing to close deferred close files smb3: improve parallel reads of large files do not reuse connection if share marked as isolated cifs: fix pcchunk length type in smb2_copychunk_range
2 parents df8c2d1 + d39fc59 commit fd88f14

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

fs/cifs/cifsfs.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ cifs_read_super(struct super_block *sb)
246246
if (cifs_sb->ctx->rasize)
247247
sb->s_bdi->ra_pages = cifs_sb->ctx->rasize / PAGE_SIZE;
248248
else
249-
sb->s_bdi->ra_pages = cifs_sb->ctx->rsize / PAGE_SIZE;
249+
sb->s_bdi->ra_pages = 2 * (cifs_sb->ctx->rsize / PAGE_SIZE);
250250

251251
sb->s_blocksize = CIFS_MAX_MSGSIZE;
252252
sb->s_blocksize_bits = 14; /* default 2**14 = CIFS_MAX_MSGSIZE */
@@ -744,6 +744,7 @@ static void cifs_umount_begin(struct super_block *sb)
744744
spin_unlock(&tcon->tc_lock);
745745
spin_unlock(&cifs_tcp_ses_lock);
746746

747+
cifs_close_all_deferred_files(tcon);
747748
/* cancel_brl_requests(tcon); */ /* BB mark all brl mids as exiting */
748749
/* cancel_notify_requests(tcon); */
749750
if (tcon->ses && tcon->ses->server) {
@@ -759,6 +760,20 @@ static void cifs_umount_begin(struct super_block *sb)
759760
return;
760761
}
761762

763+
static int cifs_freeze(struct super_block *sb)
764+
{
765+
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
766+
struct cifs_tcon *tcon;
767+
768+
if (cifs_sb == NULL)
769+
return 0;
770+
771+
tcon = cifs_sb_master_tcon(cifs_sb);
772+
773+
cifs_close_all_deferred_files(tcon);
774+
return 0;
775+
}
776+
762777
#ifdef CONFIG_CIFS_STATS2
763778
static int cifs_show_stats(struct seq_file *s, struct dentry *root)
764779
{
@@ -797,6 +812,7 @@ static const struct super_operations cifs_super_ops = {
797812
as opens */
798813
.show_options = cifs_show_options,
799814
.umount_begin = cifs_umount_begin,
815+
.freeze_fs = cifs_freeze,
800816
#ifdef CONFIG_CIFS_STATS2
801817
.show_stats = cifs_show_stats,
802818
#endif

fs/cifs/connect.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2709,6 +2709,13 @@ cifs_match_super(struct super_block *sb, void *data)
27092709

27102710
spin_lock(&cifs_tcp_ses_lock);
27112711
cifs_sb = CIFS_SB(sb);
2712+
2713+
/* We do not want to use a superblock that has been shutdown */
2714+
if (CIFS_MOUNT_SHUTDOWN & cifs_sb->mnt_cifs_flags) {
2715+
spin_unlock(&cifs_tcp_ses_lock);
2716+
return 0;
2717+
}
2718+
27122719
tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb));
27132720
if (tlink == NULL) {
27142721
/* can not match superblock if tlink were ever null */

fs/cifs/smb2ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ smb2_copychunk_range(const unsigned int xid,
16821682
pcchunk->SourceOffset = cpu_to_le64(src_off);
16831683
pcchunk->TargetOffset = cpu_to_le64(dest_off);
16841684
pcchunk->Length =
1685-
cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk));
1685+
cpu_to_le32(min_t(u64, len, tcon->max_bytes_chunk));
16861686

16871687
/* Request server copy to target from src identified by key */
16881688
kfree(retbuf);

fs/cifs/smb2pdu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,9 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
19471947
init_copy_chunk_defaults(tcon);
19481948
if (server->ops->validate_negotiate)
19491949
rc = server->ops->validate_negotiate(xid, tcon);
1950+
if (rc == 0) /* See MS-SMB2 2.2.10 and 3.2.5.5 */
1951+
if (tcon->share_flags & SMB2_SHAREFLAG_ISOLATED_TRANSPORT)
1952+
server->nosharesock = true;
19501953
tcon_exit:
19511954

19521955
free_rsp_buf(resp_buftype, rsp);

0 commit comments

Comments
 (0)