12.08.2011 21:01, Eric Sandeen wrote: [] >> And yes, 18446744073709551199 aios sounds quite alot ;) > > looks like it went negative. > > I see that in one case we set EXT4_IO_END_UNWRITTEN, but don't increment the counter. > We decrement the counter for every EXT4_IO_END_UNWRITTEN completion, I think. > > I'm not quite sure if that was intentional or not, but it might be a place to start. > I haven't though hard about this, in the middle of something else right now, > but this looks like it's a probllem in my code from that unaligned AIO patch, > perhaps... > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 3e5191f..7366488 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3640,6 +3640,7 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate) > > io_end->flag = EXT4_IO_END_UNWRITTEN; > inode = io_end->inode; > + atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten); > > /* Add the io_end to per-inode completed io list*/ > spin_lock_irqsave(&EXT4_I(inode)->i_completed_io_lock, flags); This patch does not change thing (unfortunately I forgot to reapply the debugging patch posted by Jan so don't know how many aiocbs it wants to wait). But reverting e9e3bcecf44c04b9e6b505fd8e2eb9cea58fb94d (ext4: serialize unaligned asynchronous DIO) helps, the thing goes fine without that patch. And this refcounting - I can't see why in my case the problem only happens with hot cache and only with dioread_nolock mount option (so far anyway - I weren't able to trigger it without at least one of the two conditions). BTW, ext4_end_io_buffer_write() is declared twice in fs/ext4/inode.c Thanks, /mjt -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html