From 78e5887fea05ed2c2f8be228e5c47c71f70a0b74 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Wed, 19 Apr 2023 17:13:43 -0400 Subject: [PATCH] btrfs-progs: fix kerncompat.h include ordering for libbtrfs We're keeping a libbtrfs compatible kerncompat.h around to make it easier to modify the rest of btrfs-progs. Unfortunately we also use some of kernel-lib in libbtrfs, and those also include kerncompat.h. Those getting included first means we'll pull include/kerncompat.h instead of libbtrfs/kerncompat.h, which will mess things up. Fix this by making sure we include our local copy of kerncompat.h first before we include any other header in btrfs-progs. Signed-off-by: Josef Bacik Signed-off-by: David Sterba --- libbtrfs/ctree.h | 4 ++-- libbtrfs/send-utils.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libbtrfs/ctree.h b/libbtrfs/ctree.h index e7a51c4b..ea2a680e 100644 --- a/libbtrfs/ctree.h +++ b/libbtrfs/ctree.h @@ -22,14 +22,14 @@ #include #if BTRFS_FLAT_INCLUDES +#include "libbtrfs/kerncompat.h" #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" -#include "libbtrfs/kerncompat.h" #include "libbtrfs/ioctl.h" #else +#include #include #include -#include #include #endif /* BTRFS_FLAT_INCLUDES */ diff --git a/libbtrfs/send-utils.c b/libbtrfs/send-utils.c index 831ec0dc..eb0ed5af 100644 --- a/libbtrfs/send-utils.c +++ b/libbtrfs/send-utils.c @@ -24,10 +24,10 @@ #include #include #include -#include "kernel-lib/rbtree.h" #include "libbtrfs/ctree.h" #include "libbtrfs/send-utils.h" #include "libbtrfs/ioctl.h" +#include "kernel-lib/rbtree.h" static int btrfs_subvolid_resolve_sub(int fd, char *path, size_t *path_len, u64 subvol_id);