diff mbox

FS/BTRFS/IOCTL: Fix "__put_user_unaligned" implicit declaration error.

Message ID 1378446412-5548-1-git-send-email-manjunath.goudar@linaro.org
State New
Headers show

Commit Message

manjunath.goudar@linaro.org Sept. 6, 2013, 5:46 a.m. UTC
asm-generic/uaccess-unaligned.h is been included in fs/btrfs/ioctl.c
file, to remove the "__put_user_unaligned" implicit declaration error.
Without this patch, build system can lead to following build failure.
This was observed during randconfig test.

CC      fs/btrfs/ioctl.o
fs/btrfs/ioctl.c: In function ‘btrfs_ioctl_file_extent_same’:
fs/btrfs/ioctl.c:2802:3: error: implicit declaration of function
‘__put_user_unaligned’ [-Werror=implicit-function-declaration]
   if (__put_user_unaligned(info.status, &args->info[i].status) ||
   ^
cc1: some warnings being treated as errors
make[2]: *** [fs/btrfs/ioctl.o] Error 1
make[1]: *** [fs/btrfs] Error 2
make: *** [fs] Error 2

Signed-off-by: Manjunath Goudar <manjunath.goudar@linaro.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Deepak Saxena <dsaxena@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Chris Mason <chris.mason@fusionio.com>
Cc: linux-btrfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 fs/btrfs/ioctl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij Sept. 6, 2013, 8:36 a.m. UTC | #1
On Fri, Sep 6, 2013 at 7:46 AM, Manjunath Goudar
<manjunath.goudar@linaro.org> wrote:

> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 1a5b946..6241ba2 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -44,6 +44,7 @@
>  #include <linux/uuid.h>
>  #include <linux/btrfs.h>
>  #include <linux/uaccess.h>
> +#include <asm-generic/uaccess-unaligned.h>

No, this does not work.

If you inspect <linux/uaccess.h> you realized that it includes
the <asm/uaccess.h> header for the architecture, it is then
the choice of the architecture whether it wants to use
asm-generic or not.

Instead look into the specific case causing this and check if
this is happening on an arch without the proper implementation
of uaccess and then fix that instead, or report it to the
arch maintainer.

Further this error is not caused by the btrfs core actually
using __put_user_unaligned, but through some kind of
indirection, so dig down and figure out the exact cause.

Yours,
Linus Walleij
diff mbox

Patch

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 1a5b946..6241ba2 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -44,6 +44,7 @@ 
 #include <linux/uuid.h>
 #include <linux/btrfs.h>
 #include <linux/uaccess.h>
+#include <asm-generic/uaccess-unaligned.h>
 #include "compat.h"
 #include "ctree.h"
 #include "disk-io.h"