Re: [PATCH 29/35] Btrfs ioctl code

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

 



On Thu, 2009-01-15 at 12:44 -0800, Linus Torvalds wrote:
> 
> On Thu, 15 Jan 2009, Chris Mason wrote:
> > > 
> > > Grr. Different alignment for 64-bit values, coupled with "name" not 
> > > having a size that is a multiple-of-eight.
> > 
> > Will the fd and the start of the name get aligned differently?  I'll fix
> > it up
> 
> No, since the name is byte-aligned, the only thing that happens is that 
> the total alignment (which comes from the alignment of __s64) affects the 
> final size - think about having an array of those things, and the 
> "sizeof()" gives you what the offset to the next entry in the array would 
> be.
> 
> So they'll look _exactly_ the same in all ways, except for padding at the 
> end.

Ok, that makes more sense thanks.  The kernel does:

if (copy_from_user(vol_args, arg, sizeof(*vol_args))) {
	ret = -EFAULT;
	goto out;
}

So I'll try to get something that works as expected and just trims some
bytes off the end to align things.

-chris


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

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux