linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
To: Stefan Behrens <sbehrens@giantdisaster.de>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: fix wrong pad for kernelspace arg of btrfs dev stat
Date: Thu, 16 Oct 2014 17:41:25 +0800	[thread overview]
Message-ID: <1413452485.7609.7.camel@localhost.localdomain> (raw)
In-Reply-To: <543F8F4B.5080506@giantdisaster.de>

On Thu, 2014-10-16 at 11:26 +0200, Stefan Behrens wrote:
> On Thu, 16 Oct 2014 09:53:37 +0800, Gui Hecheng wrote:
> > The @btrfs_ioctl_get_dev_stats fails to pad to 1k as descripted,
> > actually it valuates to 1032 bytes.
> > The corresponding userspace change follows this change.
> > 
> > Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
> > ---
> >  include/uapi/linux/btrfs.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> > index 2f47824..fc4e326 100644
> > --- a/include/uapi/linux/btrfs.h
> > +++ b/include/uapi/linux/btrfs.h
> > @@ -416,7 +416,7 @@ struct btrfs_ioctl_get_dev_stats {
> >  	/* out values: */
> >  	__u64 values[BTRFS_DEV_STAT_VALUES_MAX];
> >  
> > -	__u64 unused[128 - 2 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */
> > +	__u64 unused[128 - 3 - BTRFS_DEV_STAT_VALUES_MAX]; /* pad to 1k */
> 
> You can't change an existing ioctl interface like this and make it
> incompatible, the length of the structure is used in _IOWR(). Just
> change the comment from "pad to 1k" to "pad to 1032 bytes" instead.

Er... yeah, the problem exists, and such a fix seems cost much.
Since the related tool itself doesn't influence much, just scratch these
two may be a reasonable idea. ^_^

("pad to 1032 bytes" seems a bit...) 

> 
> >  };
> >  
> >  #define BTRFS_QUOTA_CTL_ENABLE	1
> > 
> 
> 



      reply	other threads:[~2014-10-16  9:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16  1:53 [PATCH] btrfs: fix wrong pad for kernelspace arg of btrfs dev stat Gui Hecheng
2014-10-16  1:53 ` [PATCH] btrfs-progs: fix wrong pad for userspace " Gui Hecheng
2014-10-16  1:53 ` [PATCH] btrfs-progs: prevent silent damage when add dev to an invalid mntpnt Gui Hecheng
2014-10-16  9:26 ` [PATCH] btrfs: fix wrong pad for kernelspace arg of btrfs dev stat Stefan Behrens
2014-10-16  9:41   ` Gui Hecheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1413452485.7609.7.camel@localhost.localdomain \
    --to=guihc.fnst@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sbehrens@giantdisaster.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).