Re: 2.6.9-mm1 oops

From: Jens Axboe
Date: Mon Oct 25 2004 - 05:34:13 EST


On Mon, Oct 25 2004, Jens Axboe wrote:
> On Mon, Oct 25 2004, Jens Axboe wrote:
> > On Mon, Oct 25 2004, Lorenzo Allegrucci wrote:
> > > On Sunday 24 October 2004 22:02, Lorenzo Allegrucci wrote:
> > > > On Sunday 24 October 2004 16:20, Lorenzo Allegrucci wrote:
> > > > > On Sunday 24 October 2004 14:30, Jens Axboe wrote:
> > > > > > On Sat, Oct 23 2004, Lorenzo Allegrucci wrote:
> > > > > > >
> > > > > > > 100% reproducible with elevator=cfq
> > > > > >
> > > > > > but not with the other io schedulers?
> > > > >
> > > > > No, now I can reproduce it with the anticipatory scheduler too.
> > > >
> > > > I've just got the same oops using XFS instead of ext3.
> > >
> > > And disabling CONFIG_PREEMPT_BKL doesn't help.
> >
> > I'll try to reproduce it here now.
>
> Something fishy is going on here - it seems to happen in the if (ret)
> cleanup in direct_io_worker(), last error was -EFAULT for this case. And
> reverting the dio eof patch 'fixes' the bug, I don't know why yet.

->head and ->tail were not initialized in the cleanup path, I'm guessing
this happens if we adjust the read to zero. Seems best to simply check
for that condition and bail early, instead of initing ->head and tail
earlier and go through the whole path.

--- /opt/kernel/BK/linux-2.6/fs/direct-io.c 2004-10-19 20:40:38.000000000 +0200
+++ linux-2.6.9-mm1/fs/direct-io.c 2004-10-25 12:27:31.283064376 +0200
@@ -987,6 +987,8 @@
isize = i_size_read(inode);
if (bytes_todo > (isize - offset))
bytes_todo = isize - offset;
+ if (!bytes_todo)
+ return 0;

for (seg = 0; seg < nr_segs && bytes_todo; seg++) {
user_addr = (unsigned long)iov[seg].iov_base;

--
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/