Skip to contentSkip to conversation

ocfs2-fix-unbalanced-locking.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 10, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: ocfs2: fix unbalanced locking
has been removed from the -mm tree. Its filename was
ocfs2-fix-unbalanced-locking.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Pavel Machek <[email protected]>
Subject: ocfs2: fix unbalanced locking

Based on what fails, function can return with nfs_sync_rwlock either locked or unlocked. That can not be right.

Always return with lock unlocked on error.

Fixes 4cd9973f9ff6 ("ocfs2: avoid inode removal while nfsd is accessing it")
Cc Mark Fasheh <[email protected]>
Cc Joel Becker <[email protected]>
Cc Junxiao Bi <[email protected]>
Cc Changwei Ge <[email protected]>
Cc Gang He <[email protected]>
Cc Jun Piao <[email protected]>

---

 fs/ocfs2/dlmglue.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
fs/ocfs2/dlmglue.c renamed from fs/ocfs2/dlmglue.c~ocfs2-fix-unbalanced-locking +7 -1
@@ -2871,9 +2871,15 @@ int ocfs2_nfs_sync_lock(struct ocfs2_sup
 
 	status = ocfs2_cluster_lock(osb, lockres, ex ? LKM_EXMODE : LKM_PRMODE,
 				    0, 0);
-	if (status < 0)
+	if (status < 0) {
 		mlog(ML_ERROR, "lock on nfs sync lock failed %d\n", status);
 
+		if (ex)
+			up_write(&osb->nfs_sync_rwlock);
+		else
+			up_read(&osb->nfs_sync_rwlock);
+	}
+
 	return status;
 }
 

_

Patches currently in -mm which might be from [email protected] are