[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120120140157.GA11241@quack.suse.cz>
Date: Fri, 20 Jan 2012 15:01:57 +0100
From: Jan Kara <jack@...e.cz>
To: Tomer Margalit <tomermargalit@...il.com>
Cc: linux-kernel@...r.kernel.org,
Nezer Zaidenberg <nzaidenberg@....com>
Subject: Re: 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@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists