From 8471e5367024587807c0e0d924498bd8c806583a Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 23 Oct 2018 10:13:58 +0000 Subject: [PATCH] Support BtrFS OBS-URL: https://build.opensuse.org/package/show/Base:System/psmisc?expand=0&rev=108 --- ...to-be-able-to-use-the-mount-identity.patch | 23 ++++++++++++------- psmisc.changes | 6 +++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch b/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch index 3324da2..286d28e 100644 --- a/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch +++ b/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch @@ -1,4 +1,4 @@ -From b2adb830fb54f1d4ae227008fc8894aa9b202f82 Mon Sep 17 00:00:00 2001 +From fbfa621f68e8edd522e0111fca72693943295df5 Mon Sep 17 00:00:00 2001 From: Werner Fink Date: Mon, 22 Oct 2018 12:02:50 +0200 Subject: [PATCH] Use mountinfo to be able to use the mount identity @@ -11,14 +11,16 @@ and older systems. Add support for name_to_handle_at() system call to get the real mount ID for each file +Support also btrfs with its subvolumes + Signed-off-by: Werner Fink --- configure.ac | 18 +- - src/fuser.c | 532 +++++++++++++++++++++++++++---------- + src/fuser.c | 537 +++++++++++++++++++++++++++---------- src/fuser.h | 19 +- testsuite/Makefile.am | 3 +- testsuite/killall.test/killall.exp | 4 + - 5 files changed, 432 insertions(+), 144 deletions(-) + 5 files changed, 437 insertions(+), 144 deletions(-) diff --git configure.ac configure.ac index 176a2fc..d8d3366 100644 @@ -64,7 +66,7 @@ index 176a2fc..d8d3366 100644 dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git src/fuser.c src/fuser.c -index c44cee8..78d2683 100644 +index c44cee8..6176ac3 100644 --- src/fuser.c +++ src/fuser.c @@ -32,6 +32,10 @@ @@ -541,7 +543,7 @@ index c44cee8..78d2683 100644 } static void -@@ -1998,16 +2074,42 @@ scan_swaps(struct names *names_head, struct inode_list *ino_head, +@@ -1998,16 +2074,47 @@ scan_swaps(struct names *names_head, struct inode_list *ino_head, fclose(fp); } @@ -573,6 +575,11 @@ index c44cee8..78d2683 100644 + mnt->nlen = nlen; + mnt->parid = parid; + mnt->dev = dev; ++ if (strncmp("btrfs", type, 5) == 0) { ++ struct stat st; ++ if (stat(mpoint, &st) >= 0) ++ mnt->dev = st.st_dev; ++ } + mnt->id = mid; + if (strncmp("nfs", type, 3) == 0) + mnt->isnfs = 1; @@ -587,7 +594,7 @@ index c44cee8..78d2683 100644 { list_t *ptr, *tmp; -@@ -2018,72 +2120,232 @@ static void clear_mntinfo(void) +@@ -2018,72 +2125,232 @@ static void clear_mntinfo(void) } } @@ -864,7 +871,7 @@ index c44cee8..78d2683 100644 /* * Determine device of links below /proc/ */ -@@ -2091,8 +2353,7 @@ static int mntstat(const char *path, struct stat *buf) +@@ -2091,8 +2358,7 @@ static int mntstat(const char *path, struct stat *buf) { char name[PATH_MAX + 1]; const char *use; @@ -874,7 +881,7 @@ index c44cee8..78d2683 100644 if ((use = realpath(path, name)) == NULL || *use != '/') { -@@ -2104,27 +2365,26 @@ static int mntstat(const char *path, struct stat *buf) +@@ -2104,27 +2370,26 @@ static int mntstat(const char *path, struct stat *buf) errno = 0; return stat(path, buf); } diff --git a/psmisc.changes b/psmisc.changes index 6a84374..c96aa5c 100644 --- a/psmisc.changes +++ b/psmisc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 23 10:10:12 UTC 2018 - Dr. Werner Fink + +- Support also btrFS entries in mountinfo, that is use stat(2) to + determine the device of the mounted subvolume (bsc#1098697, bsc#1112780) + ------------------------------------------------------------------- Mon Oct 22 10:52:10 UTC 2018 - Dr. Werner Fink