From: Trond Myklebust Date: Wed, 12 Feb 2014 13:17:00 +0000 (-0500) Subject: NFSv4.1: Minor optimisation in get_layout_by_fh_locked() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9a7fe9e8900baad5f6643000ea48b91aee895165;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git NFSv4.1: Minor optimisation in get_layout_by_fh_locked() If the filehandles match, but the igrab() fails, or the layout is freed before we can get it, then just return NULL. Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 570c8a1d2f3d..41db5258e7a7 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c @@ -127,13 +127,13 @@ static struct pnfs_layout_hdr * get_layout_by_fh_locked(struct nfs_client *clp, continue; ino = igrab(lo->plh_inode); if (!ino) - continue; + break; spin_lock(&ino->i_lock); /* Is this layout in the process of being freed? */ if (NFS_I(ino)->layout != lo) { spin_unlock(&ino->i_lock); iput(ino); - continue; + break; } pnfs_get_layout_hdr(lo); spin_unlock(&ino->i_lock);