Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6

Pull more CIFS fixes from Steve French:
"As promised, here is the remaining set of cifs/smb3 fixes for stable
(and a fix for one regression) now that they have had additional
review and testing"

* 'for-next' of git://git.samba.org/sfrench/cifs-2.6:
CIFS: Fix SMB3 mount without specifying a security mechanism
CIFS: store results of cifs_reopen_file to avoid infinite wait
CIFS: remove bad_network_name flag
CIFS: reconnect thread reschedule itself
CIFS: handle guest access errors to Windows shares
CIFS: Fix null pointer deref during read resp processing

+29 -22
-1
fs/cifs/cifsglob.h
··· 948 948 bool use_persistent:1; /* use persistent instead of durable handles */ 949 949 #ifdef CONFIG_CIFS_SMB2 950 950 bool print:1; /* set if connection to printer share */ 951 - bool bad_network_name:1; /* set if ret status STATUS_BAD_NETWORK_NAME */ 952 951 __le32 capabilities; 953 952 __u32 share_flags; 954 953 __u32 maximal_access;
+1 -2
fs/cifs/cifsproto.h
··· 79 79 extern void cifs_wake_up_task(struct mid_q_entry *mid); 80 80 extern int cifs_handle_standard(struct TCP_Server_Info *server, 81 81 struct mid_q_entry *mid); 82 - extern int cifs_discard_remaining_data(struct TCP_Server_Info *server, 83 - char *buf); 82 + extern int cifs_discard_remaining_data(struct TCP_Server_Info *server); 84 83 extern int cifs_call_async(struct TCP_Server_Info *server, 85 84 struct smb_rqst *rqst, 86 85 mid_receive_t *receive, mid_callback_t *callback,
+8 -7
fs/cifs/cifssmb.c
··· 1400 1400 * current bigbuf. 1401 1401 */ 1402 1402 int 1403 - cifs_discard_remaining_data(struct TCP_Server_Info *server, char *buf) 1403 + cifs_discard_remaining_data(struct TCP_Server_Info *server) 1404 1404 { 1405 - unsigned int rfclen = get_rfc1002_length(buf); 1405 + unsigned int rfclen = get_rfc1002_length(server->smallbuf); 1406 1406 int remaining = rfclen + 4 - server->total_read; 1407 1407 1408 1408 while (remaining > 0) { ··· 1426 1426 int length; 1427 1427 struct cifs_readdata *rdata = mid->callback_data; 1428 1428 1429 - length = cifs_discard_remaining_data(server, mid->resp_buf); 1429 + length = cifs_discard_remaining_data(server); 1430 1430 dequeue_mid(mid, rdata->result); 1431 + mid->resp_buf = server->smallbuf; 1432 + server->smallbuf = NULL; 1431 1433 return length; 1432 1434 } 1433 1435 ··· 1461 1459 1462 1460 if (server->ops->is_status_pending && 1463 1461 server->ops->is_status_pending(buf, server, 0)) { 1464 - cifs_discard_remaining_data(server, buf); 1462 + cifs_discard_remaining_data(server); 1465 1463 return -1; 1466 1464 } 1467 1465 ··· 1521 1519 cifs_dbg(FYI, "0: iov_base=%p iov_len=%u\n", 1522 1520 rdata->iov[0].iov_base, server->total_read); 1523 1521 1524 - mid->resp_buf = server->smallbuf; 1525 - server->smallbuf = NULL; 1526 - 1527 1522 /* how much data is in the response? */ 1528 1523 data_len = server->ops->read_data_length(buf); 1529 1524 if (data_offset + data_len > buflen) { ··· 1543 1544 return cifs_readv_discard(server, mid); 1544 1545 1545 1546 dequeue_mid(mid, false); 1547 + mid->resp_buf = server->smallbuf; 1548 + server->smallbuf = NULL; 1546 1549 return length; 1547 1550 } 1548 1551
+3
fs/cifs/connect.c
··· 3753 3753 if (IS_ERR(tcon)) { 3754 3754 rc = PTR_ERR(tcon); 3755 3755 tcon = NULL; 3756 + if (rc == -EACCES) 3757 + goto mount_fail_check; 3758 + 3756 3759 goto remote_path_check; 3757 3760 } 3758 3761
+3 -3
fs/cifs/file.c
··· 2597 2597 wdata->credits = credits; 2598 2598 2599 2599 if (!wdata->cfile->invalidHandle || 2600 - !cifs_reopen_file(wdata->cfile, false)) 2600 + !(rc = cifs_reopen_file(wdata->cfile, false))) 2601 2601 rc = server->ops->async_writev(wdata, 2602 2602 cifs_uncached_writedata_release); 2603 2603 if (rc) { ··· 3022 3022 rdata->credits = credits; 3023 3023 3024 3024 if (!rdata->cfile->invalidHandle || 3025 - !cifs_reopen_file(rdata->cfile, true)) 3025 + !(rc = cifs_reopen_file(rdata->cfile, true))) 3026 3026 rc = server->ops->async_readv(rdata); 3027 3027 error: 3028 3028 if (rc) { ··· 3617 3617 } 3618 3618 3619 3619 if (!rdata->cfile->invalidHandle || 3620 - !cifs_reopen_file(rdata->cfile, true)) 3620 + !(rc = cifs_reopen_file(rdata->cfile, true))) 3621 3621 rc = server->ops->async_readv(rdata); 3622 3622 if (rc) { 3623 3623 add_credits_and_wake_if(server, rdata->credits, 0);
+2 -2
fs/cifs/smb2ops.c
··· 2195 2195 if (rc) 2196 2196 goto free_pages; 2197 2197 2198 - rc = cifs_discard_remaining_data(server, buf); 2198 + rc = cifs_discard_remaining_data(server); 2199 2199 if (rc) 2200 2200 goto free_pages; 2201 2201 ··· 2221 2221 kfree(pages); 2222 2222 return rc; 2223 2223 discard_data: 2224 - cifs_discard_remaining_data(server, buf); 2224 + cifs_discard_remaining_data(server); 2225 2225 goto free_pages; 2226 2226 } 2227 2227
+12 -7
fs/cifs/smb2pdu.c
··· 562 562 * but for time being this is our only auth choice so doesn't matter. 563 563 * We just found a server which sets blob length to zero expecting raw. 564 564 */ 565 - if (blob_length == 0) 565 + if (blob_length == 0) { 566 566 cifs_dbg(FYI, "missing security blob on negprot\n"); 567 + server->sec_ntlmssp = true; 568 + } 567 569 568 570 rc = cifs_enable_signing(server, ses->sign); 569 571 if (rc) ··· 1173 1171 else 1174 1172 return -EIO; 1175 1173 1176 - if (tcon && tcon->bad_network_name) 1177 - return -ENOENT; 1178 - 1179 1174 unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL); 1180 1175 if (unc_path == NULL) 1181 1176 return -ENOMEM; ··· 1276 1277 tcon_error_exit: 1277 1278 if (rsp->hdr.sync_hdr.Status == STATUS_BAD_NETWORK_NAME) { 1278 1279 cifs_dbg(VFS, "BAD_NETWORK_NAME: %s\n", tree); 1279 - if (tcon) 1280 - tcon->bad_network_name = true; 1281 1280 } 1282 1281 goto tcon_exit; 1283 1282 } ··· 2178 2181 struct cifs_tcon *tcon, *tcon2; 2179 2182 struct list_head tmp_list; 2180 2183 int tcon_exist = false; 2184 + int rc; 2185 + int resched = false; 2186 + 2181 2187 2182 2188 /* Prevent simultaneous reconnects that can corrupt tcon->rlist list */ 2183 2189 mutex_lock(&server->reconnect_mutex); ··· 2208 2208 spin_unlock(&cifs_tcp_ses_lock); 2209 2209 2210 2210 list_for_each_entry_safe(tcon, tcon2, &tmp_list, rlist) { 2211 - if (!smb2_reconnect(SMB2_INTERNAL_CMD, tcon)) 2211 + rc = smb2_reconnect(SMB2_INTERNAL_CMD, tcon); 2212 + if (!rc) 2212 2213 cifs_reopen_persistent_handles(tcon); 2214 + else 2215 + resched = true; 2213 2216 list_del_init(&tcon->rlist); 2214 2217 cifs_put_tcon(tcon); 2215 2218 } 2216 2219 2217 2220 cifs_dbg(FYI, "Reconnecting tcons finished\n"); 2221 + if (resched) 2222 + queue_delayed_work(cifsiod_wq, &server->reconnect, 2 * HZ); 2218 2223 mutex_unlock(&server->reconnect_mutex); 2219 2224 2220 2225 /* now we can safely release srv struct */