Skip to content

Commit df01174

Browse files
Fred IsamanTrond Myklebust
authored andcommitted
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>
1 parent 1763da1 commit df01174

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fs/nfs/nfs4filelayout.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,12 @@ filelayout_free_layout_hdr(struct pnfs_layout_hdr *lo)
11841184
static struct pnfs_ds_commit_info *
11851185
filelayout_get_ds_info(struct inode *inode)
11861186
{
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;
11881193
}
11891194

11901195
static struct pnfs_layoutdriver_type filelayout_type = {

0 commit comments

Comments
 (0)