Messages in this thread | | | Date | Wed, 23 Feb 2005 23:06:59 +0000 | From | Christoph Hellwig <> | Subject | Re: [Patch 6/6] Bind Mount Extensions 0.06 |
| |
> +++ linux-2.6.11-rc4-bme0.06-bm0.01-at0.01-cc0.01-co0.01-xa0.01-ro0.01/fs/ext2/ioctl.c 2005-02-19 06:32:05 +0100 > @@ -29,7 +29,8 @@ int ext2_ioctl (struct inode * inode, st > case EXT2_IOC_SETFLAGS: { > unsigned int oldflags; > > - if (IS_RDONLY(inode)) > + if (IS_RDONLY(inode) || > + (filp && MNT_IS_RDONLY(filp->f_vfsmnt)))
doing this in every filesystem ->ioctl is a really bad idea. We need to add common handling for ext2-style file attributes first.
Also please add a file_readonly() helper - when introduced it only checks IS_RDONLY(file->f_dentry->d_inode) and once you add per-mount flags it only needs to be added in a single place. Actually probably a lowelevel one taking inode,vfsmount and wrappers for a struct file * or struct nameidata * which would cover most of the cases.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |