Re: Kernel ops with flexfiles

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After some digging I found that the number of increments and decrements for
lo->plh_refcoun't doesn't match. While the number of pnfs_get_layout_hdr matches
to the number of pnfs_put_layout_hdr calls, pnfs_layout_remove_lseg does yet
another decrement. Something like this fixes the issue:

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c13e826614b5..a7b01cd87e6a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -490,7 +490,7 @@ pnfs_layout_remove_lseg(struct pnfs_layout_hdr *lo,
        WARN_ON(test_bit(NFS_LSEG_VALID, &lseg->pls_flags));
        list_del_init(&lseg->pls_list);
        /* Matched by pnfs_get_layout_hdr in pnfs_layout_insert_lseg */
-       refcount_dec(&lo->plh_refcount);
+       refcount_dec_not_one(&lo->plh_refcount);
        if (test_bit(NFS_LSEG_LAYOUTRETURN, &lseg->pls_flags))
                return;
        if (list_empty(&lo->plh_segs) &&


Or may be we don't need refcount_dec(&lo->plh_refcount) at all.
Can someone comment on it?

Thanks,
   Tigran.


----- Original Message -----
> From: "Christoph Hellwig" <hch@xxxxxxxxxxxxx>
> To: "Tigran Mkrtchyan" <tigran.mkrtchyan@xxxxxxx>
> Cc: "linux-nfs" <linux-nfs@xxxxxxxxxxxxxxx>, "Trond Myklebust" <trond.myklebust@xxxxxxxxxxxxxxx>
> Sent: Wednesday, March 7, 2018 7:47:56 AM
> Subject: Re: Kernel ops with flexfiles

> FYI, I see very similar issues with blocklayout, also caused by the
> refcount changes.  But I didn't really didn't have any time to dig
> into it yet.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux