From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: hch@lst.de, viro@zeniv.linux.org.uk
Subject: Cleanup generic_osync_inode?
Date: Fri, 14 Aug 2009 23:48:31 +0200 [thread overview]
Message-ID: <20090814214831.GB8118@duck.suse.cz> (raw)
Hi,
I was looking at generic_osync_inode() and found out it's kind of
inconsistent with what we have in fsync() path and does not work in all
cases e.g. on ext3 / ext4. The problem is that filesystem never actually
gets to know that it should sync all metadata needed to reach the data -
generic_osync_inode() only does sync_mapping_buffers() but e.g. ext3 / ext4
don't track metadata buffers there. Then it does write_inode_now() which
would actually flush the journal, but it does so only in case inode is
I_DIRTY_DATASYNC... So there are cases where we sync the data but leave
metadata uncommitted.
What I'd imagine is that generic_osync_inode() would be just like
fdatasync call, only we'd have to add a possibility to avoid fdatawrite /
fdatawait as some callers submit / wait for data themselves. That would
nicely unify those syncing paths.
The only small problem is with an interface since ->fsync() callback
takes preferably struct file * and at least struct dentry *, while
generic_osync_inode takes just inode. Most of the callers actually have
a struct file * pointer but sync_page_range[_nolock]() do not, so that
would have to be solved somehow.
Any opinions / ideas?
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next reply other threads:[~2009-08-14 21:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 21:48 Jan Kara [this message]
2009-08-15 15:12 ` Cleanup generic_osync_inode? Christoph Hellwig
2009-08-15 15:21 ` 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=20090814214831.GB8118@duck.suse.cz \
--to=jack@suse.cz \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).