mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
NFS/pNFS: Don't leak DS commits in pnfs_generic_retry_commit()
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: c84bea5944
("NFS/pNFS: Simplify bucket layout segment reference counting")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
@@ -403,12 +403,16 @@ pnfs_bucket_get_committing(struct list_head *head,
|
|||||||
struct pnfs_commit_bucket *bucket,
|
struct pnfs_commit_bucket *bucket,
|
||||||
struct nfs_commit_info *cinfo)
|
struct nfs_commit_info *cinfo)
|
||||||
{
|
{
|
||||||
|
struct pnfs_layout_segment *lseg;
|
||||||
struct list_head *pos;
|
struct list_head *pos;
|
||||||
|
|
||||||
list_for_each(pos, &bucket->committing)
|
list_for_each(pos, &bucket->committing)
|
||||||
cinfo->ds->ncommitting--;
|
cinfo->ds->ncommitting--;
|
||||||
list_splice_init(&bucket->committing, head);
|
list_splice_init(&bucket->committing, head);
|
||||||
return pnfs_free_bucket_lseg(bucket);
|
lseg = pnfs_free_bucket_lseg(bucket);
|
||||||
|
if (!lseg)
|
||||||
|
lseg = pnfs_get_lseg(bucket->lseg);
|
||||||
|
return lseg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct nfs_commit_data *
|
static struct nfs_commit_data *
|
||||||
@@ -420,8 +424,6 @@ pnfs_bucket_fetch_commitdata(struct pnfs_commit_bucket *bucket,
|
|||||||
if (!data)
|
if (!data)
|
||||||
return NULL;
|
return NULL;
|
||||||
data->lseg = pnfs_bucket_get_committing(&data->pages, bucket, cinfo);
|
data->lseg = pnfs_bucket_get_committing(&data->pages, bucket, cinfo);
|
||||||
if (!data->lseg)
|
|
||||||
data->lseg = pnfs_get_lseg(bucket->lseg);
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user