patch-1.3.48 linux/fs/namei.c

Next file: linux/fs/open.c
Previous file: linux/fs/msdos/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.47/linux/fs/namei.c linux/fs/namei.c
@@ -371,7 +371,7 @@
 			error = -EROFS;
 		else {
 			dir->i_count++;		/* create eats the dir */
-			if (dir->i_sb->dq_op)
+			if (dir->i_sb && dir->i_sb->dq_op)
 				dir->i_sb->dq_op->initialize(dir, -1);
 			error = dir->i_op->create(dir, basename, namelen, mode, res_inode);
 			up(&dir->i_sem);
@@ -422,7 +422,7 @@
 			iput(inode);
 			return error;
 		}
-		if (inode->i_sb->dq_op)
+		if (inode->i_sb && inode->i_sb->dq_op)
 			inode->i_sb->dq_op->initialize(inode, -1);
 		newattrs.ia_size = 0;
 		newattrs.ia_valid = ATTR_SIZE;
@@ -440,7 +440,7 @@
 		put_write_access(inode);
 	} else
 		if (flag & FMODE_WRITE)
-			if (inode->i_sb->dq_op)
+			if (inode->i_sb && inode->i_sb->dq_op)
 				inode->i_sb->dq_op->initialize(inode, -1);
 	*res_inode = inode;
 	return 0;
@@ -473,7 +473,7 @@
 		return -EPERM;
 	}
 	dir->i_count++;
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	down(&dir->i_sem);
 	error = dir->i_op->mknod(dir,basename,namelen,mode,dev);
@@ -532,7 +532,7 @@
 		return -EPERM;
 	}
 	dir->i_count++;
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	down(&dir->i_sem);
 	error = dir->i_op->mkdir(dir, basename, namelen, mode & 0777 & ~current->fs->umask);
@@ -586,7 +586,7 @@
 		iput(dir);
 		return -EPERM;
 	}
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	return dir->i_op->rmdir(dir,basename,namelen);
 }
@@ -636,7 +636,7 @@
 		iput(dir);
 		return -EPERM;
 	}
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	return dir->i_op->unlink(dir,basename,namelen);
 }
@@ -680,7 +680,7 @@
 		return -EPERM;
 	}
 	dir->i_count++;
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	down(&dir->i_sem);
 	error = dir->i_op->symlink(dir,basename,namelen,oldname);
@@ -751,7 +751,7 @@
 		return -EPERM;
 	}
 	dir->i_count++;
-	if (dir->i_sb->dq_op)
+	if (dir->i_sb && dir->i_sb->dq_op)
 		dir->i_sb->dq_op->initialize(dir, -1);
 	down(&dir->i_sem);
 	error = dir->i_op->link(oldinode, dir, basename, namelen);
@@ -839,7 +839,7 @@
 		return -EPERM;
 	}
 	new_dir->i_count++;
-	if (new_dir->i_sb->dq_op)
+	if (new_dir->i_sb && new_dir->i_sb->dq_op)
 		new_dir->i_sb->dq_op->initialize(new_dir, -1);
 	down(&new_dir->i_sem);
 	error = old_dir->i_op->rename(old_dir, old_base, old_len, 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this