summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Tao2014-10-10 17:25:46 +0200
committerTom Haynes2015-02-03 20:06:47 +0100
commit566f8737630390b743d79e26e4ac855fe2758129 (patch)
tree974b19ea87f8185b4442657a51a0ce27fc70998c
parentpnfs: fail comparison when bucket verifier not set (diff)
downloadkernel-qcow2-linux-566f8737630390b743d79e26e4ac855fe2758129.tar.gz
kernel-qcow2-linux-566f8737630390b743d79e26e4ac855fe2758129.tar.xz
kernel-qcow2-linux-566f8737630390b743d79e26e4ac855fe2758129.zip
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 <tao.peng@primarydata.com>
-rw-r--r--fs/nfs/pnfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 5f7c422ebb5d..e123cfce54ee 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);