linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <mason@suse.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] O_SYNC error handling fix
Date: Mon, 16 Jan 2006 09:26:12 -0500	[thread overview]
Message-ID: <200601160926.15701.mason@suse.com> (raw)
In-Reply-To: <20060115235852.36a8bcad.akpm@osdl.org>

On Monday 16 January 2006 02:58, Andrew Morton wrote:
> Chris Mason <mason@suse.com> wrote:
> > If we hit errors during generic_osync_inode(),
> > generic_file_buffered_write will still return written ? written : status;
> >  This patch ensures the -EIO gets back up to userland at all times.
[ ... ]

>
> The patch does more than this.  It also changes the O_DIRECT logic and it
> also refuses to update the file position on I/O errors.

True, I can get rid of the O_DIRECT change, it was just to preserve the status 
variable for the -EIO test.

>
> Probably reasonable changes, but I'd like to have your description of why
> these changes were made please.
>

Skipping the file position update was because we are not returning the short 
write.  We want the next write to happen at the appropriate place given the 
number of bytes we've told userland went out.

>
> The patch also makes write() non-linuxy.  We normally return a short write
> on errors.  In this case I'd say that returning 0 (and not updating f_pos)
> would be appropriate?

With O_SYNC we've no way of knowing which bytes didn't make it down to the 
disk.  I can special case the -EIO check for just O_SYNC. I think that along 
with changing around the O_DIRECT bits will make us both happy?

-chris

  reply	other threads:[~2006-01-16 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-16  0:43 [PATCH] O_SYNC error handling fix Chris Mason
2006-01-16  7:58 ` Andrew Morton
2006-01-16 14:26   ` Chris Mason [this message]
2006-01-16 20:11     ` Andrew Morton

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=200601160926.15701.mason@suse.com \
    --to=mason@suse.com \
    --cc=akpm@osdl.org \
    --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 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).