From: Jeff Layton <jlayton@redhat.com>
To: linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org
Subject: how to handle failed writes in the middle of a set?
Date: Sat, 28 Jan 2012 06:44:22 -0500 [thread overview]
Message-ID: <20120128064422.5d5e4022@tlielax.poochiereds.net> (raw)
The SMB protocol specifies that if you don't have an oplock then writes
and reads to/from the server are not supposed to use the cache. Currently
cifs does this sort of write serially. I'd like to change it to do them
in parallel for better performance, but I'm not sure what to do in the
following situation:
Suppose we have a wsize of 64k. An application opens a file for write
and does not get an oplock. It sends down a 192k write from userspace.
cifs breaks that up into 3 SMB_COM_WRITE_AND_X calls on the wire,
fires them off in parallel and waits for them to return. The first and
third write succeed, but the second one (the one in the middle) fails
with a hard error.
How should we return from the write at that point? The alternatives I
see are:
1/ return -EIO for the whole thing, even though part of it was
successfully written?
2/ pretend only the first write succeeded, even though the part
afterward might have been corrupted?
3/ do something else?
--
Jeff Layton <jlayton@redhat.com>
next reply other threads:[~2012-01-28 11:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-28 11:44 Jeff Layton [this message]
[not found] ` <20120128064422.5d5e4022-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2012-01-28 14:36 ` how to handle failed writes in the middle of a set? James Bottomley
[not found] ` <1327761391.2924.9.camel-sFMDBYUN5F8GjUHQrlYNx2Wm91YjaHnnhRte9Li2A+AAvxtiuMwx3w@public.gmane.org>
2012-01-28 14:59 ` Jeff Layton
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=20120128064422.5d5e4022@tlielax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=linux-cifs@vger.kernel.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).