All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Alistair Francis <alistair23@gmail.com>,
	Kamil Rytarowski <kamil@netbsd.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Fam Zheng <famz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] 9pfs: include <linux/limits.h> for XATTR_SIZE_MAX
Date: Sat, 29 Jul 2017 15:50:42 +0200	[thread overview]
Message-ID: <20170729135042.GA1139@pks-xps> (raw)
In-Reply-To: <cf854184-8bc0-4a9c-b97f-8274abf538bc@amsat.org>

[-- Attachment #1: Type: text/plain, Size: 2103 bytes --]

On Fri, Jul 28, 2017 at 02:20:49PM -0300, Philippe Mathieu-Daudé wrote:
> > On Mon, Jun 26, 2017 at 12:20 PM, Patrick Steinhardt <ps@pks.im> wrote:
> >> The function `v9fs_xattrcreate` makes use of the define `XATTR_SIZE_MAX`
> >> to reject attempts of creating xattrs with an invalid size, which is
> >> defined in <linux/limits.h>. On glibc-based systems, this header is
> >> indirectly included via <limits.h>, <bits/posix1_lim.h>,
> >> <bitts/local_lim.h>, but on other platforms this is not guaranteed due
> >> to not being part of the POSIX standard. One examples are systems based
> >> on musl libc, which do not include the <linux/limits.h> indirectly,
> >> which leads to `XATTR_SIZE_MAX` being undefined.
> >>
> >> Fix this error by directly include <linux/limits.h>. As the 9P fs code
> >> is being Linux-based either way, we can simply do so without breaking
> >> other platforms. This enables building 9pfs on musl-based systems.
> >>
> >> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
> >> ---
> >>   hw/9pfs/9p.c | 1 +
> >>   1 file changed, 1 insertion(+)
> >>
> >> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> >> index 96d2683348..48cd558e96 100644
> >> --- a/hw/9pfs/9p.c
> >> +++ b/hw/9pfs/9p.c
> >> @@ -13,6 +13,7 @@
> >>
> >>   #include "qemu/osdep.h"
> >>   #include <glib/gprintf.h>
> 
> This is likely to break on BSD, but now than patchew has a NetBSD job 
> you can trigger a build RESENDing this patch.
> 
> This should probably work:
> 
> #ifdef __linux__
> 
> >> +#include <linux/limits.h>
> 
> #endif
> 
> >>   #include "hw/virtio/virtio.h"
> >>   #include "qapi/error.h"
> >>   #include "qemu/error-report.h"
> >> --
> >> 2.13.2
> 
> Regards,
> 
> Phil.

Thanks for the feedback! Is this really relevant in this context,
though? Both 9p-local.c and 9p-handle.c already include linux
headers, especially <linux/fs.h> is included without any ifdef
around. As such, I simply assumed that this code is being built
on Linux systems, only.

Regards
Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-07-29 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 19:20 [Qemu-devel] [PATCH] 9pfs: include <linux/limits.h> for XATTR_SIZE_MAX Patrick Steinhardt
2017-07-28 17:02 ` Alistair Francis
2017-07-28 17:20   ` Philippe Mathieu-Daudé
2017-07-29 13:50     ` Patrick Steinhardt [this message]
2017-07-29 19:34       ` Peter Maydell
2017-07-30 16:51         ` Kamil Rytarowski
2017-07-30 18:23           ` Peter Maydell
2017-07-30 23:07             ` Kamil Rytarowski
2017-07-31 14:23             ` Fam Zheng
2017-07-31 14:31               ` Peter Maydell
2017-07-31 14:36               ` Daniel P. Berrange
2017-07-31 14:52               ` Kamil Rytarowski
2017-08-11  6:52 ` Patrick Steinhardt

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=20170729135042.GA1139@pks-xps \
    --to=ps@pks.im \
    --cc=alistair23@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=famz@redhat.com \
    --cc=kamil@netbsd.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.