mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Tomer Margalit <tomermargalit@gmail.com>
Cc: linux-kernel@vger.kernel.org, Nezer Zaidenberg <nzaidenberg@mac.com>
Subject: Re: Failing a bio right
Date: Fri, 20 Jan 2012 15:01:57 +0100	[thread overview]
Message-ID: <20120120140157.GA11241@quack.suse.cz> (raw)
In-Reply-To: <CAG3n4CS5vyx2sn9t0geQoxa+kE+Nk9Q-0fwTCU6o9iQ33bORjA@mail.gmail.com>

  Hello,

On Thu 19-01-12 18:04:19, Tomer Margalit wrote:
> I have a make_request function that blocks writes (by using
> wait_event_interruptible on some event).
> I want the user to be able to stop the function if it takes too long
> (that's the reason for the interruptible version).
> So when the call is interrupted I call bio_endio with the EINTR error
> to signal the interruption.
> Usually this works fine, but after a lot of writes, the system says
> "lost page write due to I/O error on device".
  This is because end_buffer_write_sync() doesn't really distinguish
errors.  So when some error happens it complains about I/O error.

> At this point the process hangs.
  That is strange - you should probably collect stack trace of the failing
process (e.g. via 'echo w >/proc/sysrq-trigger'). That should tell us more.

> Is this the right way to do what I'm trying to do?
  I'm not sure how is it supposed to work. Writes happen usually in an
async manner (through page cache and flusher thread) or are you using
direct IO? Also if a write is interrupted at this point, you just lost the
content of the buffer (as it is marked clean and !uptodate). Users usually
don't like that.

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2012-01-20 14:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 16:04 Tomer Margalit
2012-01-20 14:01 ` Jan Kara [this message]
2012-01-22  9:29   ` Tomer Margalit
2012-01-23 20:14     ` Jan Kara
2012-02-28 14:34       ` Tomer Margalit
2012-02-28 14:56         ` Jan Kara
2012-02-28 15:22           ` Tomer Margalit

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=20120120140157.GA11241@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nzaidenberg@mac.com \
    --cc=tomermargalit@gmail.com \
    /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

all inboxes | Powered by JetHome®