From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [PATCH 29/35] Btrfs ioctl code Date: Thu, 15 Jan 2009 15:49:49 -0500 Message-ID: <1232052589.8269.124.camel@think.oraclecorp.com> References: <1231387045-27838-1-git-send-email-chris.mason@oracle.com> <1231387045-27838-30-git-send-email-chris.mason@oracle.com> <20090116.032900.03617624.ryusuke@osrg.net> <1232051302.8269.99.camel@think.oraclecorp.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Ryusuke Konishi , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org To: Linus Torvalds Return-path: Received: from acsinet12.oracle.com ([141.146.126.234]:53731 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933858AbZAOUuw (ORCPT ); Thu, 15 Jan 2009 15:50:52 -0500 In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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