From: Peng Tao Date: Fri, 10 Oct 2014 15:25:46 +0000 (+0800) Subject: nfs41: add a debug warning if we destroy an unempty layout X-Git-Tag: v4.14-rc1~5864^2~38^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=566f8737630390b743d79e26e4ac855fe2758129;p=platform%2Fkernel%2Flinux-rpi.git nfs41: add a debug warning if we destroy an unempty layout So that we can detect the case if some layout segments are still pinned which is surely a bug that we need to fix. Signed-off-by: Peng Tao --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 5f7c422..e123cfc 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -242,6 +242,8 @@ pnfs_put_layout_hdr(struct pnfs_layout_hdr *lo) struct inode *inode = lo->plh_inode; if (atomic_dec_and_lock(&lo->plh_refcount, &inode->i_lock)) { + if (!list_empty(&lo->plh_segs)) + WARN_ONCE(1, "NFS: BUG unfreed layout segments.\n"); pnfs_detach_layout_hdr(lo); spin_unlock(&inode->i_lock); pnfs_free_layout_hdr(lo);