[GFS2] GFS2 not checking pointer on create when running under nfsd
authorSteve French <smfrench@gmail.com>
Fri, 20 Jul 2007 18:07:26 +0000 (13:07 -0500)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 10 Oct 2007 07:54:46 +0000 (08:54 +0100)
When looking at an unrelated problem, I noticed that nfsd does not
set nameidata pointer on create (ie nd is NULL).  This should
cause an oops in some cases in which when NFSd is mounted over GFS2.

Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/ops_inode.c

index 911c115..5b8b994 100644 (file)
@@ -69,7 +69,7 @@ static int gfs2_create(struct inode *dir, struct dentry *dentry,
                        mark_inode_dirty(inode);
                        break;
                } else if (PTR_ERR(inode) != -EEXIST ||
-                          (nd->intent.open.flags & O_EXCL)) {
+                          (nd && (nd->intent.open.flags & O_EXCL))) {
                        gfs2_holder_uninit(ghs);
                        return PTR_ERR(inode);
                }