Преглед на файлове

[GFS2] GFS2 not checking pointer on create when running under nfsd

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>
Steve French преди 18 години
родител
ревизия
afd0942d98
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      fs/gfs2/ops_inode.c

+ 1 - 1
fs/gfs2/ops_inode.c

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