[PATCH FOR REVIEW] Extended attribute

Martin Matuska mm at FreeBSD.org
Mon Oct 17 22:14:56 UTC 2011


On 15. 10. 2011 0:21, Xin LI wrote:
> Hi,
>  
> I think we hit a bug in sa_find_sizes:
>  
>  - hdrsize grows by 4 bytes each time;
>  - On return, hdrsize is rounded up to nearest 8 byte boundary;
>  - On the other hand, when testing for whether spill is needed, the
> code uses sum of (*total + hdrsize) and rounds that number up to
> nearest 8 byte boundary.
>  
> This causes a problem when *total==306 and hdrsize==12.  We have:
>  
>     (306 + 12) = 318
>     ROUNDUP(318, 8) = 320
>  
> On return, we have:
>  
>     total = 306
>     hdrsize = 16
>  
> And spill is unset.  This would lead to a panic.
>  
> Comments?
>  
> Cheers,
In my opinion your computation is correct, the bugfix should go to HEAD
and be reported to OpenSolaris, too.
If you want I can report it upstream.

-- 
Martin Matuska
FreeBSD committer
http://blog.vx.sk


More information about the zfs-devel mailing list