From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/2] push MS_RDONLY check from ->write_super into caller
Date: Wed, 6 May 2009 23:33:34 +0100 [thread overview]
Message-ID: <20090506223334.GY8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20090506221912.GX8633@ZenIV.linux.org.uk>
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...
next prev parent reply other threads:[~2009-05-06 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-06 20:16 [PATCH 1/2] push MS_RDONLY check from ->write_super into caller Christoph Hellwig
2009-05-06 22:19 ` Al Viro
2009-05-06 22:33 ` Al Viro [this message]
2009-05-07 6:15 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090506223334.GY8633@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.