linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Junxiao Bi <junxiao.bi@oracle.com>
Cc: linux-fsdevel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Trond Myklebust <trond.myklebust@primarydata.com>,
	Christoph Hellwig <hch@infradead.org>,
	Dave Chinner <david@fromorbit.com>, Theodore Ts'o <tytso@mit.edu>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Oleg Drokin <oleg.drokin@intel.com>,
	Joseph Qi <joseph.qi@huawei.com>,
	Joel Becker <jlbec@evilplan.org>, Mark Fasheh <mfasheh@suse.com>
Subject: Re: [RFC] write(2) semantics wrt return values and current position
Date: Thu, 9 Apr 2015 12:42:33 +0100	[thread overview]
Message-ID: <20150409114232.GU889@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20150409112333.GT889@ZenIV.linux.org.uk>

On Thu, Apr 09, 2015 at 12:23:33PM +0100, Al Viro wrote:
> On Thu, Apr 09, 2015 at 12:48:44PM +0800, Junxiao Bi wrote:
> 
> > Looks like if generic_file_direct_write() return -EIOCBQUEUED and
> > IS_SYNC(inode) is true, the sync range is also wrong.
> 
> *blink*
> 
> But in that case it shouldn't do any syncing at all...  Oh, right.
> Unlike generic_file_write_iter(), if goes into the sync pathway
> in that case (which was another long-standing bug there)...
> 
> Fixed and force-pushed.

	BTW, what about the locks needed to stabilize the file size?
generic_write_checks() in there looks like it's called too late - we
can't tell a damn thing about alignment until we do it, so at the very
least we might need to recheck that.

	Can we move it _before_ ocfs2_prepare_inode_for_write()?
Having it done twice in case we end up on "can't really do O_DIRECT, unlock
and redo everything without asking for direct IO" path is not a problem -
we just need to save the original count and restore it before that
goto relock in there.

	Do we hold enough locks to make sure that file size won't change
under us?

  reply	other threads:[~2015-04-09 11:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06 16:02 [RFC] write(2) semantics wrt return values and current position Al Viro
2015-04-06 18:13 ` Linus Torvalds
2015-04-06 19:29   ` Al Viro
2015-04-06 19:50     ` Al Viro
2015-04-06 20:04 ` Drokin, Oleg
2015-04-06 20:09   ` Al Viro
2015-04-06 20:39     ` Drokin, Oleg
2015-04-07 15:25 ` Christoph Hellwig
2015-04-08 19:24 ` Al Viro
2015-04-08 20:57   ` Al Viro
2015-04-08 21:20     ` Al Viro
2015-04-09  4:48       ` Junxiao Bi
2015-04-09 11:23         ` Al Viro
2015-04-09 11:42           ` Al Viro [this message]
2015-04-10 14:31             ` Junxiao Bi

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=20150409114232.GU889@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@huawei.com \
    --cc=junxiao.bi@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=miklos@szeredi.hu \
    --cc=oleg.drokin@intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=trond.myklebust@primarydata.com \
    --cc=tytso@mit.edu \
    /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).