diff mbox

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

Message ID 1365622608-21015-1-git-send-email-jlayton@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jeff Layton April 10, 2013, 7:36 p.m. UTC
The second check was added in commit 65b62a29 but it will never be true.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/nfs/delegation.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Trond Myklebust April 10, 2013, 7:59 p.m. UTC | #1
On Wed, 2013-04-10 at 15:36 -0400, Jeff Layton wrote:
> The second check was added in commit 65b62a29 but it will never be true.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> ---
>  fs/nfs/delegation.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
> index f30bd1e..57db324 100644
> --- a/fs/nfs/delegation.c
> +++ b/fs/nfs/delegation.c
> @@ -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) {

Thanks! Applied...
diff mbox

Patch

diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index f30bd1e..57db324 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -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) {