patch-2.1.30 linux/fs/namei.c

Next file: linux/fs/proc/array.c
Previous file: linux/fs/msdos/msdosfs_syms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/fs/namei.c linux/fs/namei.c
@@ -652,7 +652,10 @@
 	}
 	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);
+	down(&dir->i_sem);
+	error = dir->i_op->rmdir(dir,basename,namelen);
+	up(&dir->i_sem);
+	return error;
 }
 
 asmlinkage int sys_rmdir(const char * pathname)
@@ -705,7 +708,10 @@
 	}
 	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);
+	down(&dir->i_sem);
+	error = dir->i_op->unlink(dir,basename,namelen);
+	up(&dir->i_sem);
+	return error;
 }
 
 asmlinkage int sys_unlink(const char * pathname)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov