btrfs-progs: build: add missing symbols to libbtrfs - new patch
diff mbox series

Message ID 3c3f25e4-7f36-b1f3-0e82-9745e0eb84cb@orange.fr
State New
Headers show
Series
  • btrfs-progs: build: add missing symbols to libbtrfs - new patch
Related show

Commit Message

Julien_N Oct. 23, 2019, 2:47 p.m. UTC
According to Johannes Thumshirn, there are missing some symbols in libbtrfs.

I've made that patch, it seem to work with snapper.

$ snapper --version
snapper 0.8.4
flags btrfs,lvm,ext4,xattrs,rollback,btrfs-quota,no-selinux


BR.

Julien


---
 Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

            kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
            kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
-           extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
+           extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h \
+                 volumes.h disk-io.h delayed-ref.h print-tree.h
free-space-cache.h \
+                 common/device-scan.h common/utils.h
common/path-utils.h transaction.h
 libbtrfsutil_major := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_MAJOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
 libbtrfsutil_minor := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_MINOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
 libbtrfsutil_patch := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_PATCH ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)

Comments

Julien_N Oct. 23, 2019, 3:44 p.m. UTC | #1
After testing with ldd tool, there is some other stuff to add:

(please apply those 2 patchs)

---
 Makefile | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 616d469a..edab7fff 100644
--- a/Makefile
+++ b/Makefile
@@ -149,19 +149,17 @@ cmds_objects = cmds/subvolume.o cmds/filesystem.o
cmds/device.o cmds/scrub.o \
            cmds/property.o cmds/filesystem-usage.o
cmds/inspect-dump-tree.o \
            cmds/inspect-dump-super.o cmds/inspect-tree-stats.o
cmds/filesystem-du.o \
            mkfs/common.o check/mode-common.o check/mode-lowmem.o
-libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o
btrfs-list.o \
-           kernel-lib/radix-tree.o extent-cache.o extent_io.o ctree.o
volumes.o \
-             disk-io.o extent-tree.o delayed-ref.o print-tree.o
common/device-scan.o \
-             common/utils.o free-space-cache.o common/path-utils.o
root-tree.o \
-             transaction.o file-item.o kernel-lib/raid56.o
kernel-lib/tables.o \
-           kernel-lib/crc32c.o common/messages.o \
-           uuid-tree.o utils-lib.o common/rbtree-utils.o
+libbtrfs_objects = $(objects) send-stream.o send-utils.o
kernel-lib/rbtree.o btrfs-list.o \
+           kernel-lib/radix-tree.o extent-cache.o extent_io.o \
+           kernel-lib/crc32c.o common/messages.o libbtrfsutil/errors.o \
+           uuid-tree.o utils-lib.o common/rbtree-utils.o
libbtrfsutil/subvolume.o
 libbtrfs_headers = send-stream.h send-utils.h send.h
kernel-lib/rbtree.h btrfs-list.h \
            kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
            kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
            extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h \
                  volumes.h disk-io.h delayed-ref.h print-tree.h
free-space-cache.h \
-                 common/device-scan.h common/utils.h
common/path-utils.h transaction.h
+                 common/device-scan.h common/utils.h
common/path-utils.h transaction.h \
+                 libbtrfsutil/btrfsutil.h
 libbtrfsutil_major := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_MAJOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
 libbtrfsutil_minor := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_MINOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
 libbtrfsutil_patch := $(shell sed -rn 's/^\#define
BTRFS_UTIL_VERSION_PATCH ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
David Sterba Oct. 23, 2019, 5:07 p.m. UTC | #2
On Wed, Oct 23, 2019 at 05:44:32PM +0200, Julien_N wrote:
> After testing with ldd tool, there is some other stuff to add:
> 
> (please apply those 2 patchs)

Thanks. While this fixes the compilation, the new object files define
new public symbols in libbtrfs and that requires version bump of the
version (at least, or use .sym definition).

The state of libbtrfs is reaching point where we should deprecate it and
enhance libbtrfsutil to provide all the functinonality as this is a
proper library. Unlike libbtrfs.

Snapper needs are covered only partially, the stream dumping is not
there, qgroup and random other things I checked are in the API.

New symbols in a library should be fine with a minor version bump,
so that's probably going to be the sufficient fix for now.

Patch
diff mbox series

diff --git a/Makefile b/Makefile
index 21bf2717..616d469a 100644
--- a/Makefile
+++ b/Makefile
@@ -150,13 +150,18 @@  cmds_objects = cmds/subvolume.o cmds/filesystem.o
cmds/device.o cmds/scrub.o \
            cmds/inspect-dump-super.o cmds/inspect-tree-stats.o
cmds/filesystem-du.o \
            mkfs/common.o check/mode-common.o check/mode-lowmem.o
 libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o
btrfs-list.o \
-           kernel-lib/radix-tree.o extent-cache.o extent_io.o \
+           kernel-lib/radix-tree.o extent-cache.o extent_io.o ctree.o
volumes.o \
+             disk-io.o extent-tree.o delayed-ref.o print-tree.o
common/device-scan.o \
+             common/utils.o free-space-cache.o common/path-utils.o
root-tree.o \
+             transaction.o file-item.o kernel-lib/raid56.o
kernel-lib/tables.o \
            kernel-lib/crc32c.o common/messages.o \
            uuid-tree.o utils-lib.o common/rbtree-utils.o
 libbtrfs_headers = send-stream.h send-utils.h send.h
kernel-lib/rbtree.h btrfs-list.h \