pNFS: Fix bugs in _pnfs_return_layout
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 30 Nov 2016 15:19:09 +0000 (10:19 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Thu, 1 Dec 2016 22:21:49 +0000 (17:21 -0500)
commit24408f5282df58210cfecaa6851b2be52f5c661f
tree846785c469295d127b3d5184277540c2bb035efa
parentfe1cf9469d7bcb6af27e42eb555a41b0135bce4a
pNFS: Fix bugs in _pnfs_return_layout

We need to honour the NFS_LAYOUT_RETURN_REQUESTED bit regardless of
whether or not there are layout segments pending.
Furthermore, we should ensure that we leave the plh_return_segs list
empty.

This patch fixes a memory leak of the layout segments on plh_return_segs.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/pnfs.c