On Sat, 2007-06-23 at 08:51 +0100, Christoph Hellwig wrote: > > diff -puN fs/namei.c~18-24-sys-mknodat-elevate-write-count-for-vfs-mknod-create fs/namei.c > > --- lxc/fs/namei.c~18-24-sys-mknodat-elevate-write-count-for-vfs-mknod-create 2007-06-21 23:23:25.000000000 -0700 > > +++ lxc-dave/fs/namei.c 2007-06-21 23:23:25.000000000 -0700 > > @@ -1897,14 +1897,26 @@ asmlinkage long sys_mknodat(int dfd, con > > if (!IS_ERR(dentry)) { > > switch (mode & S_IFMT) { > > case 0: case S_IFREG: > > + error = mnt_want_write(nd.mnt); > > + if (error) > > + break; > > error = vfs_create(nd.dentry->d_inode,dentry,mode,&nd); > > + mnt_drop_write(nd.mnt); > > break; > > case S_IFCHR: case S_IFBLK: > > + error = mnt_want_write(nd.mnt); > > + if (error) > > + break; > > error = vfs_mknod(nd.dentry->d_inode,dentry,mode, > > new_decode_dev(dev)); > > + mnt_drop_write(nd.mnt); > > break; > > case S_IFIFO: case S_IFSOCK: > > + error = mnt_want_write(nd.mnt); > > + if (error) > > + break; > > error = vfs_mknod(nd.dentry->d_inode,dentry,mode,0); > > + mnt_drop_write(nd.mnt); > > break; > > case S_IFDIR: > > error = -EPERM; > > Should we just take the calls outside the switch statement? Yeah, that's much better. I assume we don't care whether we're getting -EROFS or -EPERM/-EINVAL for the S_IFDIR and default cases? -- Dave - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html