public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs_end_io_direct() with negative size?
@ 2006-08-11 17:43 Zach Brown
  2006-08-14  0:22 ` Nathan Scott
  0 siblings, 1 reply; 2+ messages in thread
From: Zach Brown @ 2006-08-11 17:43 UTC (permalink / raw)
  To: xfs


So, I was lost in fs/direct-io.c chasing yet another bug when I noticed
that a recent unrelated change might have changed the semantics of the
end_io() call.

   http://www.kernel.org/hg/linux-2.6/?cs=34c151cf341f

Notice how that changes the aio path to set 'transferred' to -EIO based
on dio->io_error before calling dio_complete() instead of after, like
the sync path does with its possibly negative 'ret'.

So it looks like xfs_end_io_direct() can now get a -ve size if, say,
someone unplugs a drive part-way through a dio+aio write.  There's an
ASSERT() in there that makes me wonder if this is something we should be
worrying about.

- z

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: xfs_end_io_direct() with negative size?
  2006-08-11 17:43 xfs_end_io_direct() with negative size? Zach Brown
@ 2006-08-14  0:22 ` Nathan Scott
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Scott @ 2006-08-14  0:22 UTC (permalink / raw)
  To: Zach Brown; +Cc: xfs

On Fri, Aug 11, 2006 at 10:43:12AM -0700, Zach Brown wrote:
> 
> So, I was lost in fs/direct-io.c chasing yet another bug when I noticed
> that a recent unrelated change might have changed the semantics of the
> end_io() call.
> 
>    http://www.kernel.org/hg/linux-2.6/?cs=34c151cf341f
> 
> Notice how that changes the aio path to set 'transferred' to -EIO based
> on dio->io_error before calling dio_complete() instead of after, like
> the sync path does with its possibly negative 'ret'.
> 
> So it looks like xfs_end_io_direct() can now get a -ve size if, say,
> someone unplugs a drive part-way through a dio+aio write.  There's an
> ASSERT() in there that makes me wonder if this is something we should be
> worrying about.

Its harmless.  It was written when there was no way a negative byte
count would be coming back at us from the dio code.  We should simply
remove the assert.

cheers.

-- 
Nathan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-14  0:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-11 17:43 xfs_end_io_direct() with negative size? Zach Brown
2006-08-14  0:22 ` Nathan Scott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox