Skip to content

Commit

Permalink
NFSv4.1: Clear lseg pointer in ->doio function
Browse files Browse the repository at this point in the history
Now that we have access to the pointer, clear it immediately after
the put, instead of in caller.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Fred Isaman authored and Trond Myklebust committed Mar 11, 2011
1 parent c76069b commit 36fe432
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/nfs/pagelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ static void nfs_pageio_doio(struct nfs_pageio_descriptor *desc)
{
if (!list_empty(&desc->pg_list)) {
int error = desc->pg_doio(desc);
desc->pg_lseg = NULL;
if (error < 0)
desc->pg_error = error;
else
Expand Down
2 changes: 2 additions & 0 deletions fs/nfs/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc)
nbytes -= rsize;
} while (nbytes != 0);
put_lseg(lseg);
desc->pg_lseg = NULL;

return ret;

Expand Down Expand Up @@ -357,6 +358,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc)
0, lseg);
out:
put_lseg(lseg);
desc->pg_lseg = NULL;
return ret;
}

Expand Down
2 changes: 2 additions & 0 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc)
} while (nbytes != 0);

put_lseg(lseg);
desc->pg_lseg = NULL;
return ret;

out_bad:
Expand Down Expand Up @@ -1005,6 +1006,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc)
ret = nfs_write_rpcsetup(req, data, &nfs_write_full_ops, desc->pg_count, 0, lseg, desc->pg_ioflags);
out:
put_lseg(lseg); /* Cleans any gotten in ->pg_test */
desc->pg_lseg = NULL;
return ret;
}

Expand Down

0 comments on commit 36fe432

Please sign in to comment.