Skip to contentSkip to conversation

cifs: update comments - [s/GlobalSMBSesLock/cifs_file_list_lock/g]

PATCH In review Suresh Jayaraman 2 participants 2 messages Oct 18, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: update comments - [s/GlobalSMBSesLock/cifs_file_list_lock/g]

GlobalSMBSesLock is now cifs_file_list_lock. Update comments to reflect this.

OTOH, isn't there is a cleaner way instead of acquiring spin_lock and doing spin_unlock in succession in cifs_oplock_break to ensure we already grabbed the reference? Is this really needed?

---

 fs/cifs/cifsglob.h |    2 +-
 fs/cifs/file.c     |    2 +-
 fs/cifs/misc.c     |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
fs/cifs/cifsglob.h +1 -1
index 18ee0ad..06906ef 100644
@@ -669,7 +669,7 @@ require use of the stronger protocol */
  *  GlobalMid_Lock protects:
  *	list operations on pending_mid_q and oplockQ
  *      updates to XID counters, multiplex id  and SMB sequence numbers
- *  GlobalSMBSesLock protects:
+ *  cifs_file_list_lock protects:
  *	list operations on tcp and SMB session lists and tCon lists
  *  f_owner.lock protects certain per file struct operations
  *  mapping->page_lock protects certain per page operations
fs/cifs/file.c +1 -1
index a3634e4..b06943b 100644
@@ -2381,7 +2381,7 @@ void cifs_oplock_break(struct work_struct *work)
 	/*
 	 * We might have kicked in before is_valid_oplock_break()
 	 * finished grabbing reference for us.  Make sure it's done by
-	 * waiting for GlobalSMSSeslock.
+	 * waiting for cifs_file_list_lock.
 	 */
 	spin_lock(&cifs_file_list_lock);
 	spin_unlock(&cifs_file_list_lock);
fs/cifs/misc.c +1 -1
index de6073c..0ef002f 100644
@@ -587,7 +587,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv)
 				 * cifs_oplock_break_put() can't be called
 				 * from here.  Get reference after queueing
 				 * succeeded.  cifs_oplock_break() will
-				 * synchronize using GlobalSMSSeslock.
+				 * synchronize using cifs_file_list_lock.
 				 */
 				if (queue_work(system_nrt_wq,
 					       &netfile->oplock_break))
Reviewed-by
#2 lore raw
In reply to a message not in the archive
Quoted 7 lines · On Mon, 18 Oct 2010 23:52:18 +0530 Suresh Jayaraman…

GlobalSMBSesLock is now cifs_file_list_lock. Update comments to reflect this.

OTOH, isn't there is a cleaner way instead of acquiring spin_lock and doing spin_unlock in succession in cifs_oplock_break to ensure we already grabbed the reference? Is this really needed?

I wish there were -- it's certainly ugly.

We need to make sure we have references held for the oplock break workqueue job. Typically, we'd take those references first and then queue the work. If something goes wrong however and we can't queue that job, then we'd have to ensure that we put those references.

There's a problem here though, is_valid_oplock_break is run in cifsd thread. If we end up putting the references in this context, we can end up tearing things down and doing blocking SMB calls. If cifsd does that, it'll deadlock.

We could (in principle) add a completion variable or something for this, but the lock/unlock works just as well for this purpose.

Comment fix looks fine: