From 210f9c0ae07cb645db305bcdcb89b443a9ba80a7 Mon Sep 17 00:00:00 2001 From: Alexander Kanavin Date: Wed, 4 Apr 2018 14:13:17 +0300 Subject: btrfs-tools: update to 4.15.1 Drop upstreamed 0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch Add ftw-subdir-walk.patch as it resolves the RECIPE_NO_UPDATE_REASON. Add --disable-zstd as libzstd isn't provided in oe-core. Fix wic testcase, as the minimal fs size is now bigger. (From OE-Core rev: 94b645aa77a4193371e8c77ddc477ec00d858961) Signed-off-by: Alexander Kanavin Signed-off-by: Richard Purdie --- ...ith-musl-missing-header-include-for-dev_t.patch | 26 -------- .../btrfs-tools/btrfs-tools/ftw-subdir-walk.patch | 69 ++++++++++++++++++++++ 2 files changed, 69 insertions(+), 26 deletions(-) delete mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch create mode 100644 meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch (limited to 'meta/recipes-devtools/btrfs-tools/btrfs-tools') diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch deleted file mode 100644 index 790676b9cb..0000000000 --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch +++ /dev/null @@ -1,26 +0,0 @@ -From bc35c4caebb57cc8b96c30c25432b12ca8dc18d5 Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin -Date: Fri, 6 Oct 2017 15:03:49 +0300 -Subject: [PATCH] Fix build with musl (missing header include for dev_t). - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin ---- - convert/source-fs.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/convert/source-fs.h b/convert/source-fs.h -index 23f3356..6fd770f 100644 ---- a/convert/source-fs.h -+++ b/convert/source-fs.h -@@ -20,6 +20,7 @@ - #include "kerncompat.h" - #include - #include -+#include - - #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID - --- -2.14.1 - diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch new file mode 100644 index 0000000000..fbe0c47849 --- /dev/null +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/ftw-subdir-walk.patch @@ -0,0 +1,69 @@ +From patchwork Wed Mar 28 06:39:09 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: btrfs-progs: mkfs/rootdir: Don't follow symbolic link when calcuating + size +From: Qu Wenruo +X-Patchwork-Id: 10312225 +Message-Id: <20180328063909.937-1-wqu@suse.com> +To: linux-btrfs@vger.kernel.org +Date: Wed, 28 Mar 2018 14:39:09 +0800 + +[BUG] +If we have a symbolic link in rootdir pointing to non-existing location, +mkfs.btrfs --rootdir will just fail: +------ +$ mkfs.btrfs -f --rootdir /tmp/rootdir/ /dev/data/btrfs +btrfs-progs v4.15.1 +See http://btrfs.wiki.kernel.org for more information. + +ERROR: ftw subdir walk of /tmp/rootdir/ failed: No such file or directory +------ + +[CAUSE] +Commit 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method +to make size estimate easier") add extra ftw walk to estimate the +filesystem size. + +Such default ftw walk will follow symbolic link and gives ENOENT error. + +[FIX] +Use nftw() to specify FTW_PHYS so we won't follow symbolic link for size +calculation. + +Reported-by: Alexander Kanavin +Fixes: 599a0abed564 ("btrfs-progs: mkfs/rootdir: Use over-reserve method to make size estimate easier") +Signed-off-by: Qu Wenruo +Upstream-Status: Submitted [https://patchwork.kernel.org/patch/10312225/] +--- + mkfs/rootdir.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/mkfs/rootdir.c b/mkfs/rootdir.c +index a1d223a2408a..33c3ff1e18cf 100644 +--- a/mkfs/rootdir.c ++++ b/mkfs/rootdir.c +@@ -696,7 +696,7 @@ out: + } + + static int ftw_add_entry_size(const char *fpath, const struct stat *st, +- int type) ++ int type, struct FTW *ftwbuf) + { + /* + * Failed to read the directory, mostly due to EPERM. Abort ASAP, so +@@ -731,7 +731,12 @@ u64 btrfs_mkfs_size_dir(const char *dir_name, u32 sectorsize, u64 min_dev_size, + fs_block_size = sectorsize; + ftw_data_size = 0; + ftw_meta_nr_inode = 0; +- ret = ftw(dir_name, ftw_add_entry_size, 10); ++ ++ /* ++ * Symbolic link is not followed when creating files, so no need to ++ * follow them here. ++ */ ++ ret = nftw(dir_name, ftw_add_entry_size, 10, FTW_PHYS); + if (ret < 0) { + error("ftw subdir walk of %s failed: %s", dir_name, + strerror(errno)); -- cgit v1.2.3-54-g00ecf