aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4filelayout.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-24 14:50:34 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:39 -0400
commitdf0117481cd94dbb8970f4be9d05b0568fa09ab1 (patch)
tree8de0587b5e1be30510925392577e0ad8aac32bc4 /fs/nfs/nfs4filelayout.c
parent1763da1234cba663b849476d451bdccac5147859 (diff)
NFS: Prevent garbage cinfo->ds from leaking out
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>
Diffstat (limited to 'fs/nfs/nfs4filelayout.c')
-rw-r--r--fs/nfs/nfs4filelayout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 806a55f513d9..80a63f6d9e14 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -1184,7 +1184,12 @@ filelayout_free_layout_hdr(struct pnfs_layout_hdr *lo)
1184static struct pnfs_ds_commit_info * 1184static struct pnfs_ds_commit_info *
1185filelayout_get_ds_info(struct inode *inode) 1185filelayout_get_ds_info(struct inode *inode)
1186{ 1186{
1187 return &FILELAYOUT_FROM_HDR(NFS_I(inode)->layout)->commit_info; 1187 struct pnfs_layout_hdr *layout = NFS_I(inode)->layout;
1188
1189 if (layout == NULL)
1190 return NULL;
1191 else
1192 return &FILELAYOUT_FROM_HDR(layout)->commit_info;
1188} 1193}
1189 1194
1190static struct pnfs_layoutdriver_type filelayout_type = { 1195static struct pnfs_layoutdriver_type filelayout_type = {