aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-11-24 17:17:59 -0500
committerSteve French <sfrench@us.ibm.com>2009-11-24 17:17:59 -0500
commit8e6c0332d5032aef2d3bc8f41771f999112c8c66 (patch)
tree2b6282cd749f7a80f1ca34995f0e984a639cc144
parentac50e950784cae1c26ad9e09ebd8f8c706131eb3 (diff)
[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>
-rw-r--r--fs/cifs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 627a60a6c1b1..32771f581b67 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,
643 * O_EXCL: optimize away the lookup, but don't hash the dentry. Let 643 * O_EXCL: optimize away the lookup, but don't hash the dentry. Let
644 * the VFS handle the create. 644 * the VFS handle the create.
645 */ 645 */
646 if (nd->flags & LOOKUP_EXCL) { 646 if (nd && (nd->flags & LOOKUP_EXCL)) {
647 d_instantiate(direntry, NULL); 647 d_instantiate(direntry, NULL);
648 return 0; 648 return 0;
649 } 649 }
@@ -675,7 +675,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
675 * reduction in network traffic in the other paths. 675 * reduction in network traffic in the other paths.
676 */ 676 */
677 if (pTcon->unix_ext) { 677 if (pTcon->unix_ext) {
678 if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) && 678 if (nd && !(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY)) &&
679 (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open && 679 (nd->flags & LOOKUP_OPEN) && !pTcon->broken_posix_open &&
680 (nd->intent.open.flags & O_CREAT)) { 680 (nd->intent.open.flags & O_CREAT)) {
681 rc = cifs_posix_open(full_path, &newInode, nd->path.mnt, 681 rc = cifs_posix_open(full_path, &newInode, nd->path.mnt,