NFS/pNFS: Don't leak DS commits in pnfs_generic_retry_commit()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 6 Jan 2021 16:54:57 +0000 (11:54 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:31 +0000 (18:27 +0100)
commitb666f394d6b8858c579df5dbe906d59517d82889
treed39acd1247b65dbc0388465cc0bc1909e91efcc5
parent067aefcdfc1e50662b9ac80d3662c4fff3075313
NFS/pNFS: Don't leak DS commits in pnfs_generic_retry_commit()

commit 46c9ea1d4fee4cf1f8cc6001b9c14aae61b3d502 upstream.

We must ensure that we pass a layout segment to nfs_retry_commit() when
we're cleaning up after pnfs_bucket_alloc_ds_commits(). Otherwise,
requests that should be committed to the DS will get committed to the
MDS.
Do so by ensuring that pnfs_bucket_get_committing() always tries to
return a layout segment when it returns a non-empty page list.

Fixes: c84bea59449a ("NFS/pNFS: Simplify bucket layout segment reference counting")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs_nfs.c