1
0
Fork 0

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>
hifive-unleashed-5.1
Peng Tao 2014-10-10 23:25:46 +08:00 committed by Tom Haynes
parent 80c76fe314
commit 566f873763
1 changed files with 2 additions and 0 deletions

View File

@ -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);