Skip to contentSkip to conversation

nfs: remove unnecessary check for NULL inode->i_flock from nfs_delegation_claim_locks

PATCH Applied Jeff Layton 2 participants 2 messages Apr 10, 2013

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

PATCH 1/1 nfs: remove unnecessary check for NULL inode->i_flock from nfs_delegation_claim_locks

The second check was added in commit 65b62a29 but it will never be true.

---
 fs/nfs/delegation.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfs/delegation.c +1 -3
index f30bd1e..57db324 100644
@@ -71,10 +71,8 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
 	int status = 0;
 
 	if (inode->i_flock == NULL)
-		return 0;
-
-	if (inode->i_flock == NULL)
 		goto out;
+
 	/* Protect inode->i_flock using the file locks lock */
 	lock_flocks();
 	for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {
Signature · 1 line
1.7.11.7
#1 lore raw
Quoted 13 lines · Jeff Layton

The second check was added in commit 65b62a29 but it will never be true.

---
 fs/nfs/delegation.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/nfs/delegation.c +0 -0
index f30bd1e..57db324 100644
@@ -71,10 +71,8 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
 	int status = 0;

fs/nfs/delegation.c static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_ · line 78

Quoted 10 lines
fs/nfs/delegation.c +1 -3
 
 	if (inode->i_flock == NULL)
-		return 0;
-
-	if (inode->i_flock == NULL)
 		goto out;
+
 	/* Protect inode->i_flock using the file locks lock */
 	lock_flocks();
 	for (fl = inode->i_flock; fl != NULL; fl = fl->fl_next) {

Thanks! Applied...

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com