]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jul 2019 10:50:06 +0000 (12:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jul 2019 10:50:06 +0000 (12:50 +0200)
added patches:
nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch

queue-4.9/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch b/queue-4.9/nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch
new file mode 100644 (file)
index 0000000..8a6b2fb
--- /dev/null
@@ -0,0 +1,129 @@
+From c32cc30c0544f13982ee0185d55f4910319b1a79 Mon Sep 17 00:00:00 2001
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+Date: Thu, 11 Jul 2019 20:52:18 -0700
+Subject: nilfs2: do not use unexported cpu_to_le32()/le32_to_cpu() in uapi header
+
+From: Masahiro Yamada <yamada.masahiro@socionext.com>
+
+commit c32cc30c0544f13982ee0185d55f4910319b1a79 upstream.
+
+cpu_to_le32/le32_to_cpu is defined in include/linux/byteorder/generic.h,
+which is not exported to user-space.
+
+UAPI headers must use the ones prefixed with double-underscore.
+
+Detected by compile-testing exported headers:
+
+  include/linux/nilfs2_ondisk.h: In function `nilfs_checkpoint_set_snapshot':
+  include/linux/nilfs2_ondisk.h:536:17: error: implicit declaration of function `cpu_to_le32' [-Werror=implicit-function-declaration]
+    cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) |  \
+                   ^
+  include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
+   NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
+   ^~~~~~~~~~~~~~~~~~~~
+  include/linux/nilfs2_ondisk.h:536:29: error: implicit declaration of function `le32_to_cpu' [-Werror=implicit-function-declaration]
+    cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) |  \
+                               ^
+  include/linux/nilfs2_ondisk.h:552:1: note: in expansion of macro `NILFS_CHECKPOINT_FNS'
+   NILFS_CHECKPOINT_FNS(SNAPSHOT, snapshot)
+   ^~~~~~~~~~~~~~~~~~~~
+  include/linux/nilfs2_ondisk.h: In function `nilfs_segment_usage_set_clean':
+  include/linux/nilfs2_ondisk.h:622:19: error: implicit declaration of function `cpu_to_le64' [-Werror=implicit-function-declaration]
+    su->su_lastmod = cpu_to_le64(0);
+                     ^~~~~~~~~~~
+
+Link: http://lkml.kernel.org/r/20190605053006.14332-1-yamada.masahiro@socionext.com
+Fixes: e63e88bc53ba ("nilfs2: move ioctl interface and disk layout to uapi separately")
+Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
+Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
+Cc: Arnd Bergmann <arnd@arndb.de>
+Cc: Greg KH <gregkh@linuxfoundation.org>
+Cc: Joe Perches <joe@perches.com>
+Cc: <stable@vger.kernel.org>   [4.9+]
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ include/uapi/linux/nilfs2_ondisk.h |   24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+--- a/include/uapi/linux/nilfs2_ondisk.h
++++ b/include/uapi/linux/nilfs2_ondisk.h
+@@ -28,7 +28,7 @@
+ #include <linux/types.h>
+ #include <linux/magic.h>
+-
++#include <asm/byteorder.h>
+ #define NILFS_INODE_BMAP_SIZE 7
+@@ -532,19 +532,19 @@ enum {
+ static inline void                                                    \
+ nilfs_checkpoint_set_##name(struct nilfs_checkpoint *cp)              \
+ {                                                                     \
+-      cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) |          \
+-                                 (1UL << NILFS_CHECKPOINT_##flag));   \
++      cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) |      \
++                                   (1UL << NILFS_CHECKPOINT_##flag)); \
+ }                                                                     \
+ static inline void                                                    \
+ nilfs_checkpoint_clear_##name(struct nilfs_checkpoint *cp)            \
+ {                                                                     \
+-      cp->cp_flags = cpu_to_le32(le32_to_cpu(cp->cp_flags) &          \
++      cp->cp_flags = __cpu_to_le32(__le32_to_cpu(cp->cp_flags) &      \
+                                  ~(1UL << NILFS_CHECKPOINT_##flag));  \
+ }                                                                     \
+ static inline int                                                     \
+ nilfs_checkpoint_##name(const struct nilfs_checkpoint *cp)            \
+ {                                                                     \
+-      return !!(le32_to_cpu(cp->cp_flags) &                           \
++      return !!(__le32_to_cpu(cp->cp_flags) &                         \
+                 (1UL << NILFS_CHECKPOINT_##flag));                    \
+ }
+@@ -594,20 +594,20 @@ enum {
+ static inline void                                                    \
+ nilfs_segment_usage_set_##name(struct nilfs_segment_usage *su)                \
+ {                                                                     \
+-      su->su_flags = cpu_to_le32(le32_to_cpu(su->su_flags) |          \
++      su->su_flags = __cpu_to_le32(__le32_to_cpu(su->su_flags) |      \
+                                  (1UL << NILFS_SEGMENT_USAGE_##flag));\
+ }                                                                     \
+ static inline void                                                    \
+ nilfs_segment_usage_clear_##name(struct nilfs_segment_usage *su)      \
+ {                                                                     \
+       su->su_flags =                                                  \
+-              cpu_to_le32(le32_to_cpu(su->su_flags) &                 \
++              __cpu_to_le32(__le32_to_cpu(su->su_flags) &             \
+                           ~(1UL << NILFS_SEGMENT_USAGE_##flag));      \
+ }                                                                     \
+ static inline int                                                     \
+ nilfs_segment_usage_##name(const struct nilfs_segment_usage *su)      \
+ {                                                                     \
+-      return !!(le32_to_cpu(su->su_flags) &                           \
++      return !!(__le32_to_cpu(su->su_flags) &                         \
+                 (1UL << NILFS_SEGMENT_USAGE_##flag));                 \
+ }
+@@ -618,15 +618,15 @@ NILFS_SEGMENT_USAGE_FNS(ERROR, error)
+ static inline void
+ nilfs_segment_usage_set_clean(struct nilfs_segment_usage *su)
+ {
+-      su->su_lastmod = cpu_to_le64(0);
+-      su->su_nblocks = cpu_to_le32(0);
+-      su->su_flags = cpu_to_le32(0);
++      su->su_lastmod = __cpu_to_le64(0);
++      su->su_nblocks = __cpu_to_le32(0);
++      su->su_flags = __cpu_to_le32(0);
+ }
+ static inline int
+ nilfs_segment_usage_clean(const struct nilfs_segment_usage *su)
+ {
+-      return !le32_to_cpu(su->su_flags);
++      return !__le32_to_cpu(su->su_flags);
+ }
+ /**
index 853273a5bcccbabd51f7cc7f82f46cf2971d5b4f..eb30dc39f8ba8babb6d638434a956d05501f58ee 100644 (file)
@@ -39,3 +39,4 @@ vmci-fix-integer-overflow-in-vmci-handle-arrays.patch
 mips-remove-superfluous-check-for-__linux__.patch
 revert-e1000e-fix-cyclic-resets-at-link-up-with-active-tx.patch
 e1000e-start-network-tx-queue-only-when-link-is-up.patch
+nilfs2-do-not-use-unexported-cpu_to_le32-le32_to_cpu-in-uapi-header.patch