diff options
author | Steve French <sfrench@us.ibm.com> | 2009-11-24 22:17:59 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-11-24 22:17:59 +0000 |
commit | 8e6c0332d5032aef2d3bc8f41771f999112c8c66 (patch) | |
tree | 2b6282cd749f7a80f1ca34995f0e984a639cc144 /fs | |
parent | ac50e950784cae1c26ad9e09ebd8f8c706131eb3 (diff) | |
download | linux-3.10-8e6c0332d5032aef2d3bc8f41771f999112c8c66.tar.gz linux-3.10-8e6c0332d5032aef2d3bc8f41771f999112c8c66.tar.bz2 linux-3.10-8e6c0332d5032aef2d3bc8f41771f999112c8c66.zip |
[CIFS] fix oops in cifs_lookup during net boot
Fixes bugzilla.kernel.org bug number 14641
Lookup called during network boot (network root filesystem
for diskless workstation) has case where nd is null in
lookup. This patch fixes that in cifs_lookup.
(Shirish noted that 2.6.30 and 2.6.31 stable need the same check)
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com>
Acked-by: Jeff Layton <jlayton@redhat.com>
Tested-by: Vladimir Stavrinov <vs@inist.ru>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 627a60a6c1b..32771f581b6 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -643,7 +643,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, * O_EXCL: optimize away the lookup, but don't hash the dentry. Let * the VFS handle the create. */ - if (nd->flags & LOOKUP_EXCL) { + if (nd && (nd->flags & LOOKUP_EXCL)) { d_instantiate(direntry, NULL); return 0; } @@ -675,7 +675,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, * reduction in network traffic in the other paths. */ if (pTcon->unix_ext) { - if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && + if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open && (nd->intent.open.flags & O_CREAT)) { rc = cifs_posix_open(full_path, &newInode, nd->path.mnt, |