From 7521a3c566dda7bb09576975324fc0a08a79ad14 Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 11 Jul 2007 18:30:34 +0000 Subject: [CIFS] Fix oops in cifs_create when nfsd server exports cifs mount nfsd is passing null nameidata (probably the only one doing that) on call to create - cifs was missing one check for this. Note that running nfsd over a cifs mount requires specifying fsid on the nfs exports entry and requires mounting cifs with serverino mount option. Signed-off-by: Steve French --- fs/cifs/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/cifs/dir.c') diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 38706e8496a..def89f23fe5 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -264,7 +264,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, direntry->d_op = &cifs_dentry_ops; d_instantiate(direntry, newinode); } - if ((nd->flags & LOOKUP_OPEN) == FALSE) { + if ((nd == NULL /* nfsd case - nfs srv does not set nd */) || + ((nd->flags & LOOKUP_OPEN) == FALSE)) { /* mknod case - do not leave file open */ CIFSSMBClose(xid, pTcon, fileHandle); } else if (newinode) { -- cgit v1.2.3-18-g5258