Re: [PATCH 1/2] push MS_RDONLY check from ->write_super into caller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 06, 2009 at 11:19:12PM +0100, Al Viro wrote:
> On Wed, May 06, 2009 at 10:16:05PM +0200, Christoph Hellwig wrote:
> > Add a central MS_RDONLY to sync_super instead of having it in the ->write_super
> > methods (and even that not consistently).  The other two callers are already
> > protected:  sync_filesystems has the same s_umount protected MS_RDONLY check
> > and file_fsync can only be called on a writeable file descriptor.
> > 
> > Also make sure to clear s_dirt if it was set on a read-only superblock to
> > avoid calling into these filesystems again and again.
> 
> > Index: vfs-2.6/fs/affs/super.c
> > Index: vfs-2.6/fs/bfs/inode.c
> > Index: vfs-2.6/fs/ext2/super.c
> > Index: vfs-2.6/fs/fat/inode.c
> > Index: vfs-2.6/fs/hfs/super.c
> > Index: vfs-2.6/fs/hfsplus/super.c
> > Index: vfs-2.6/fs/jffs2/fs.c
> > Index: vfs-2.6/fs/jffs2/super.c
> > Index: vfs-2.6/fs/nilfs2/super.c
> > Index: vfs-2.6/fs/super.c
> > Index: vfs-2.6/fs/sysv/inode.c
> > Index: vfs-2.6/fs/ufs/super.c
> 
> You've missed xfs.  Added and applied (reiserfs, ext4 and exofs are also
> not touched, but they don't need a change here).

Eh...  Actually, this is wrong as described.  ->fsync() *can* be called
for file opened r/o.  Moreover, fs might decide to go r/o on its own.
file_fsync() is not widely used, but users include affs, bfs, fat, hfs,
hfsplus and ufs.  No go, at least as long as file_fsync() is used for
those.

Patch dropped until we decide what to do with those.  It shouldn't be
all that hard to push file_fsync() out of existence, so it might be
doable, but...
--
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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux