summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/smb2misc.c')
-rw-r--r--fs/cifs/smb2misc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index 389fb9f8c84e..3d383489b9cf 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -549,19 +549,19 @@ smb2_is_valid_lease_break(char *buffer)
549 list_for_each(tmp1, &server->smb_ses_list) { 549 list_for_each(tmp1, &server->smb_ses_list) {
550 ses = list_entry(tmp1, struct cifs_ses, smb_ses_list); 550 ses = list_entry(tmp1, struct cifs_ses, smb_ses_list);
551 551
552 spin_lock(&cifs_file_list_lock);
553 list_for_each(tmp2, &ses->tcon_list) { 552 list_for_each(tmp2, &ses->tcon_list) {
554 tcon = list_entry(tmp2, struct cifs_tcon, 553 tcon = list_entry(tmp2, struct cifs_tcon,
555 tcon_list); 554 tcon_list);
555 spin_lock(&tcon->open_file_lock);
556 cifs_stats_inc( 556 cifs_stats_inc(
557 &tcon->stats.cifs_stats.num_oplock_brks); 557 &tcon->stats.cifs_stats.num_oplock_brks);
558 if (smb2_tcon_has_lease(tcon, rsp, lw)) { 558 if (smb2_tcon_has_lease(tcon, rsp, lw)) {
559 spin_unlock(&cifs_file_list_lock); 559 spin_unlock(&tcon->open_file_lock);
560 spin_unlock(&cifs_tcp_ses_lock); 560 spin_unlock(&cifs_tcp_ses_lock);
561 return true; 561 return true;
562 } 562 }
563 spin_unlock(&tcon->open_file_lock);
563 } 564 }
564 spin_unlock(&cifs_file_list_lock);
565 } 565 }
566 } 566 }
567 spin_unlock(&cifs_tcp_ses_lock); 567 spin_unlock(&cifs_tcp_ses_lock);
@@ -603,7 +603,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
603 tcon = list_entry(tmp1, struct cifs_tcon, tcon_list); 603 tcon = list_entry(tmp1, struct cifs_tcon, tcon_list);
604 604
605 cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks); 605 cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks);
606 spin_lock(&cifs_file_list_lock); 606 spin_lock(&tcon->open_file_lock);
607 list_for_each(tmp2, &tcon->openFileList) { 607 list_for_each(tmp2, &tcon->openFileList) {
608 cfile = list_entry(tmp2, struct cifsFileInfo, 608 cfile = list_entry(tmp2, struct cifsFileInfo,
609 tlist); 609 tlist);
@@ -615,7 +615,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
615 615
616 cifs_dbg(FYI, "file id match, oplock break\n"); 616 cifs_dbg(FYI, "file id match, oplock break\n");
617 cinode = CIFS_I(d_inode(cfile->dentry)); 617 cinode = CIFS_I(d_inode(cfile->dentry));
618 618 spin_lock(&cfile->file_info_lock);
619 if (!CIFS_CACHE_WRITE(cinode) && 619 if (!CIFS_CACHE_WRITE(cinode) &&
620 rsp->OplockLevel == SMB2_OPLOCK_LEVEL_NONE) 620 rsp->OplockLevel == SMB2_OPLOCK_LEVEL_NONE)
621 cfile->oplock_break_cancelled = true; 621 cfile->oplock_break_cancelled = true;
@@ -637,14 +637,14 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
637 clear_bit( 637 clear_bit(
638 CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2, 638 CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2,
639 &cinode->flags); 639 &cinode->flags);
640 640 spin_unlock(&cfile->file_info_lock);
641 queue_work(cifsiod_wq, &cfile->oplock_break); 641 queue_work(cifsiod_wq, &cfile->oplock_break);
642 642
643 spin_unlock(&cifs_file_list_lock); 643 spin_unlock(&tcon->open_file_lock);
644 spin_unlock(&cifs_tcp_ses_lock); 644 spin_unlock(&cifs_tcp_ses_lock);
645 return true; 645 return true;
646 } 646 }
647 spin_unlock(&cifs_file_list_lock); 647 spin_unlock(&tcon->open_file_lock);
648 spin_unlock(&cifs_tcp_ses_lock); 648 spin_unlock(&cifs_tcp_ses_lock);
649 cifs_dbg(FYI, "No matching file for oplock break\n"); 649 cifs_dbg(FYI, "No matching file for oplock break\n");
650 return true; 650 return true;