pnfs: Increase the refcount when LAYOUTGET fails the first time
authorYanchuan Nian <ycnian@gmail.com>
Fri, 4 Jan 2013 12:19:49 +0000 (20:19 +0800)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 4 Jan 2013 15:50:42 +0000 (10:50 -0500)
The layout will be set unusable if LAYOUTGET fails. Is it reasonable to
increase the refcount iff LAYOUTGET fails the first time?

Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: stable@vger.kernel.org [>= 3.7]
fs/nfs/pnfs.c

index e7165d915362838ab485e51ddde95db97ecd96c0..d00260b0810332c622e82faa44d4d94b75c111db 100644 (file)
@@ -254,7 +254,7 @@ static void
 pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit)
 {
        lo->plh_retry_timestamp = jiffies;
-       if (test_and_set_bit(fail_bit, &lo->plh_flags))
+       if (!test_and_set_bit(fail_bit, &lo->plh_flags))
                atomic_inc(&lo->plh_refcount);
 }