lkml.org 
[lkml]   [2012]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Failing a bio right
  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


\
 
 \ /
  Last update: 2012-01-20 15:05    [from the cache]
©2003-2011 Jasper Spaans