Re: tree corrupted on disk quota full

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Thu, 11 Jan 2007, Andy Whitcroft wrote:
>
> > So I repeat: either you use "xwrite()" (and handle the partial case), or 
> > you use "write_in_full()" (and the partial case is an *ERROR*). There is 
> > no sane middle ground in between those cases.
> 
> Things should be safe in general with the code as it is as we are
> checking the write length.

NO WE ARE NOT.

I already pointed you to write_buffer(). It used to do the right thing. It 
doesn't any more. And it doesn't, exactly because you converted it away 
from a loop that did it right, to doing "write_in_full()" and NOT checking 
the return value properly.

The thing is, if you support partial writes (ie xwrite()), you need to do 
it in a loop, and then the correct thing to check for is "zero or error".

Once you don't do a loop (ie "write_in_full()" - the whole _point_ is to 
not do the loop, after all), you need to either expand that check to "zero 
or error or partial" (which just makes the code _more_ complex), or you 
need to make "write_in_full()" just return an error for the partial case.

Which is why I'm harping on this issue: either we use "xwrite()", or we 
fix "write_in_full()" to return errors on partials. Because the "middle 
ground", where write_in_full() emulates the partial case of "xwrite()" is 
actually MORE complex than "xwrite()" itself.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]