Skip to content

Commit 45c3c62

Browse files
committed
Merge tag '6.6-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: "Three small SMB3 client fixes, one to improve a null check and two minor cleanups" * tag '6.6-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: fix some minor typos and repeated words smb3: correct places where ENOTSUPP is used instead of preferred EOPNOTSUPP smb3: move server check earlier when setting channel sequence number
2 parents 39e0c8a + 2c75426 commit 45c3c62

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

fs/smb/client/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2680,7 +2680,7 @@ int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start,
26802680
}
26812681

26822682
cifsFileInfo_put(cfile);
2683-
return -ENOTSUPP;
2683+
return -EOPNOTSUPP;
26842684
}
26852685

26862686
int cifs_truncate_page(struct address_space *mapping, loff_t from)

fs/smb/client/smb2ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ smb2_adjust_credits(struct TCP_Server_Info *server,
297297
cifs_server_dbg(VFS, "request has less credits (%d) than required (%d)",
298298
credits->value, new_val);
299299

300-
return -ENOTSUPP;
300+
return -EOPNOTSUPP;
301301
}
302302

303303
spin_lock(&server->req_lock);
@@ -1161,7 +1161,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
11611161
/* Use a fudge factor of 256 bytes in case we collide
11621162
* with a different set_EAs command.
11631163
*/
1164-
if(CIFSMaxBufSize - MAX_SMB2_CREATE_RESPONSE_SIZE -
1164+
if (CIFSMaxBufSize - MAX_SMB2_CREATE_RESPONSE_SIZE -
11651165
MAX_SMB2_CLOSE_RESPONSE_SIZE - 256 <
11661166
used_len + ea_name_len + ea_value_len + 1) {
11671167
rc = -ENOSPC;
@@ -4591,7 +4591,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
45914591

45924592
if (shdr->Command != SMB2_READ) {
45934593
cifs_server_dbg(VFS, "only big read responses are supported\n");
4594-
return -ENOTSUPP;
4594+
return -EOPNOTSUPP;
45954595
}
45964596

45974597
if (server->ops->is_session_expired &&

fs/smb/client/smb2pdu.c

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,26 @@ smb2_hdr_assemble(struct smb2_hdr *shdr, __le16 smb2_cmd,
8989
struct TCP_Server_Info *server)
9090
{
9191
struct smb3_hdr_req *smb3_hdr;
92+
9293
shdr->ProtocolId = SMB2_PROTO_NUMBER;
9394
shdr->StructureSize = cpu_to_le16(64);
9495
shdr->Command = smb2_cmd;
95-
if (server->dialect >= SMB30_PROT_ID) {
96-
/* After reconnect SMB3 must set ChannelSequence on subsequent reqs */
97-
smb3_hdr = (struct smb3_hdr_req *)shdr;
98-
/* if primary channel is not set yet, use default channel for chan sequence num */
99-
if (SERVER_IS_CHAN(server))
100-
smb3_hdr->ChannelSequence =
101-
cpu_to_le16(server->primary_server->channel_sequence_num);
102-
else
103-
smb3_hdr->ChannelSequence = cpu_to_le16(server->channel_sequence_num);
104-
}
96+
10597
if (server) {
98+
/* After reconnect SMB3 must set ChannelSequence on subsequent reqs */
99+
if (server->dialect >= SMB30_PROT_ID) {
100+
smb3_hdr = (struct smb3_hdr_req *)shdr;
101+
/*
102+
* if primary channel is not set yet, use default
103+
* channel for chan sequence num
104+
*/
105+
if (SERVER_IS_CHAN(server))
106+
smb3_hdr->ChannelSequence =
107+
cpu_to_le16(server->primary_server->channel_sequence_num);
108+
else
109+
smb3_hdr->ChannelSequence =
110+
cpu_to_le16(server->channel_sequence_num);
111+
}
106112
spin_lock(&server->req_lock);
107113
/* Request up to 10 credits but don't go over the limit. */
108114
if (server->credits >= server->max_credits)
@@ -2234,7 +2240,7 @@ create_durable_v2_buf(struct cifs_open_parms *oparms)
22342240
* (most servers default to 120 seconds) and most clients default to 0.
22352241
* This can be overridden at mount ("handletimeout=") if the user wants
22362242
* a different persistent (or resilient) handle timeout for all opens
2237-
* opens on a particular SMB3 mount.
2243+
* on a particular SMB3 mount.
22382244
*/
22392245
buf->dcontext.Timeout = cpu_to_le32(oparms->tcon->handle_timeout);
22402246
buf->dcontext.Flags = cpu_to_le32(SMB2_DHANDLE_FLAG_PERSISTENT);
@@ -2379,7 +2385,7 @@ add_twarp_context(struct kvec *iov, unsigned int *num_iovec, __u64 timewarp)
23792385
return 0;
23802386
}
23812387

2382-
/* See See http://technet.microsoft.com/en-us/library/hh509017(v=ws.10).aspx */
2388+
/* See http://technet.microsoft.com/en-us/library/hh509017(v=ws.10).aspx */
23832389
static void setup_owner_group_sids(char *buf)
23842390
{
23852391
struct owner_group_sids *sids = (struct owner_group_sids *)buf;
@@ -3124,6 +3130,7 @@ void
31243130
SMB2_ioctl_free(struct smb_rqst *rqst)
31253131
{
31263132
int i;
3133+
31273134
if (rqst && rqst->rq_iov) {
31283135
cifs_small_buf_release(rqst->rq_iov[0].iov_base); /* request */
31293136
for (i = 1; i < rqst->rq_nvec; i++)

fs/smb/client/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <linux/bvec.h>
1919
#include <linux/highmem.h>
2020
#include <linux/uaccess.h>
21-
#include <asm/processor.h>
21+
#include <linux/processor.h>
2222
#include <linux/mempool.h>
2323
#include <linux/sched/signal.h>
2424
#include <linux/task_io_accounting_ops.h>

0 commit comments

Comments
 (0)