Skip to content

Commit

Permalink
NFS: Prevent garbage cinfo->ds from leaking out
Browse files Browse the repository at this point in the history
This is a bugfix that applies on top of the previous directio patches,
that fixes a bug introduced in "NFS: create struct nfs_commit_info".

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 Apr 27, 2012
1 parent 1763da1 commit df01174
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/nfs/nfs4filelayout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,12 @@ filelayout_free_layout_hdr(struct pnfs_layout_hdr *lo)
static struct pnfs_ds_commit_info *
filelayout_get_ds_info(struct inode *inode)
{
return &FILELAYOUT_FROM_HDR(NFS_I(inode)->layout)->commit_info;
struct pnfs_layout_hdr *layout = NFS_I(inode)->layout;

if (layout == NULL)
return NULL;
else
return &FILELAYOUT_FROM_HDR(layout)->commit_info;
}

static struct pnfs_layoutdriver_type filelayout_type = {
Expand Down

0 comments on commit df01174

Please sign in to comment.