aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/misc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 20:47:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-14 20:47:31 -0400
commit87dbe42a16b654e33665756c63e96c0fa73eb003 (patch)
treead599282acc109a939a06bf879f13dabeca13499 /fs/cifs/misc.c
parentd3304cadb2e24517938e24efd58fd9ee6504fefe (diff)
parent3514de3fd5fab518520e393152d3f4e3d0441d8d (diff)
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Including: - nine bug fixes for stable. Some of these we found at the recent two weeks of SMB3 test events/plugfests. - significant improvements in reconnection (e.g. if server or network crashes) especially when mounted with "persistenthandles" or to server which advertises Continuous Availability on the share. - a new mount option "idsfromsid" which improves POSIX compatibility in some cases (when winbind not configured e.g.) by better (and faster) fetching uid/gid from acl (when "cifsacl" mount option is enabled). NB: we are almost complete work on "cifsacl" (querying mode/uid/gid from ACL) for SMB3, but SMB3 support for cifsacl is not included in this set. - improved handling for SMB3 "credits" (even if server is buggy) Still working on two sets of changes: - cifsacl enablement for SMB3 - cleanup of RFC1001 length calculation (so we can handle encryption and multichannel and RDMA) And a couple of new bugs were reported recently (unrelated to above) so will probably have another merge request next week" * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: (21 commits) CIFS: Retrieve uid and gid from special sid if enabled CIFS: Add new mount option to set owner uid and gid from special sids in acl CIFS: Reset read oplock to NONE if we have mandatory locks after reopen CIFS: Fix persistent handles re-opening on reconnect SMB2: Separate RawNTLMSSP authentication from SMB2_sess_setup SMB2: Separate Kerberos authentication from SMB2_sess_setup Expose cifs module parameters in sysfs Cleanup missing frees on some ioctls Enable previous version support Do not send SMB3 SET_INFO request if nothing is changing SMB3: Add mount parameter to allow user to override max credits fs/cifs: reopen persistent handles on reconnect Clarify locking of cifs file and tcon structures and make more granular Fix regression which breaks DFS mounting fs/cifs: keep guid when assigning fid to fileinfo SMB3: GUIDs should be constructed as random but valid uuids Set previous session id correctly on SMB3 reconnect cifs: Limit the overall credit acquired Display number of credits available Add way to query creation time of file via cifs xattr ...
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r--fs/cifs/misc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 813fe13c2ae1..c6729156f9a0 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -120,6 +120,7 @@ tconInfoAlloc(void)
120 ++ret_buf->tc_count; 120 ++ret_buf->tc_count;
121 INIT_LIST_HEAD(&ret_buf->openFileList); 121 INIT_LIST_HEAD(&ret_buf->openFileList);
122 INIT_LIST_HEAD(&ret_buf->tcon_list); 122 INIT_LIST_HEAD(&ret_buf->tcon_list);
123 spin_lock_init(&ret_buf->open_file_lock);
123#ifdef CONFIG_CIFS_STATS 124#ifdef CONFIG_CIFS_STATS
124 spin_lock_init(&ret_buf->stat_lock); 125 spin_lock_init(&ret_buf->stat_lock);
125#endif 126#endif
@@ -465,7 +466,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
465 continue; 466 continue;
466 467
467 cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks); 468 cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks);
468 spin_lock(&cifs_file_list_lock); 469 spin_lock(&tcon->open_file_lock);
469 list_for_each(tmp2, &tcon->openFileList) { 470 list_for_each(tmp2, &tcon->openFileList) {
470 netfile = list_entry(tmp2, struct cifsFileInfo, 471 netfile = list_entry(tmp2, struct cifsFileInfo,
471 tlist); 472 tlist);
@@ -495,11 +496,11 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
495 &netfile->oplock_break); 496 &netfile->oplock_break);
496 netfile->oplock_break_cancelled = false; 497 netfile->oplock_break_cancelled = false;
497 498
498 spin_unlock(&cifs_file_list_lock); 499 spin_unlock(&tcon->open_file_lock);
499 spin_unlock(&cifs_tcp_ses_lock); 500 spin_unlock(&cifs_tcp_ses_lock);
500 return true; 501 return true;
501 } 502 }
502 spin_unlock(&cifs_file_list_lock); 503 spin_unlock(&tcon->open_file_lock);
503 spin_unlock(&cifs_tcp_ses_lock); 504 spin_unlock(&cifs_tcp_ses_lock);
504 cifs_dbg(FYI, "No matching file for oplock break\n"); 505 cifs_dbg(FYI, "No matching file for oplock break\n");
505 return true; 506 return true;
@@ -613,9 +614,9 @@ backup_cred(struct cifs_sb_info *cifs_sb)
613void 614void
614cifs_del_pending_open(struct cifs_pending_open *open) 615cifs_del_pending_open(struct cifs_pending_open *open)
615{ 616{
616 spin_lock(&cifs_file_list_lock); 617 spin_lock(&tlink_tcon(open->tlink)->open_file_lock);
617 list_del(&open->olist); 618 list_del(&open->olist);
618 spin_unlock(&cifs_file_list_lock); 619 spin_unlock(&tlink_tcon(open->tlink)->open_file_lock);
619} 620}
620 621
621void 622void
@@ -635,7 +636,7 @@ void
635cifs_add_pending_open(struct cifs_fid *fid, struct tcon_link *tlink, 636cifs_add_pending_open(struct cifs_fid *fid, struct tcon_link *tlink,
636 struct cifs_pending_open *open) 637 struct cifs_pending_open *open)
637{ 638{
638 spin_lock(&cifs_file_list_lock); 639 spin_lock(&tlink_tcon(tlink)->open_file_lock);
639 cifs_add_pending_open_locked(fid, tlink, open); 640 cifs_add_pending_open_locked(fid, tlink, open);
640 spin_unlock(&cifs_file_list_lock); 641 spin_unlock(&tlink_tcon(open->tlink)->open_file_lock);
641} 642}