Dr. Werner Fink 2018-10-23 10:13:58 +00:00 committed by Git OBS Bridge
parent 07c0ab41a5
commit 8471e53670
2 changed files with 21 additions and 8 deletions

View File

@ -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 <werner@suse.de> From: Werner Fink <werner@suse.de>
Date: Mon, 22 Oct 2018 12:02:50 +0200 Date: Mon, 22 Oct 2018 12:02:50 +0200
Subject: [PATCH] Use mountinfo to be able to use the mount identity 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 Add support for name_to_handle_at() system call to
get the real mount ID for each file get the real mount ID for each file
Support also btrfs with its subvolumes
Signed-off-by: Werner Fink <werner@suse.de> Signed-off-by: Werner Fink <werner@suse.de>
--- ---
configure.ac | 18 +- configure.ac | 18 +-
src/fuser.c | 532 +++++++++++++++++++++++++++---------- src/fuser.c | 537 +++++++++++++++++++++++++++----------
src/fuser.h | 19 +- src/fuser.h | 19 +-
testsuite/Makefile.am | 3 +- testsuite/Makefile.am | 3 +-
testsuite/killall.test/killall.exp | 4 + 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 diff --git configure.ac configure.ac
index 176a2fc..d8d3366 100644 index 176a2fc..d8d3366 100644
@ -64,7 +66,7 @@ index 176a2fc..d8d3366 100644
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
diff --git src/fuser.c src/fuser.c diff --git src/fuser.c src/fuser.c
index c44cee8..78d2683 100644 index c44cee8..6176ac3 100644
--- src/fuser.c --- src/fuser.c
+++ src/fuser.c +++ src/fuser.c
@@ -32,6 +32,10 @@ @@ -32,6 +32,10 @@
@ -541,7 +543,7 @@ index c44cee8..78d2683 100644
} }
static void 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); fclose(fp);
} }
@ -573,6 +575,11 @@ index c44cee8..78d2683 100644
+ mnt->nlen = nlen; + mnt->nlen = nlen;
+ mnt->parid = parid; + mnt->parid = parid;
+ mnt->dev = dev; + 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; + mnt->id = mid;
+ if (strncmp("nfs", type, 3) == 0) + if (strncmp("nfs", type, 3) == 0)
+ mnt->isnfs = 1; + mnt->isnfs = 1;
@ -587,7 +594,7 @@ index c44cee8..78d2683 100644
{ {
list_t *ptr, *tmp; 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/ * 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]; char name[PATH_MAX + 1];
const char *use; const char *use;
@ -874,7 +881,7 @@ index c44cee8..78d2683 100644
if ((use = realpath(path, name)) == NULL || *use != '/') 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; errno = 0;
return stat(path, buf); return stat(path, buf);
} }

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Oct 23 10:10:12 UTC 2018 - Dr. Werner Fink <werner@suse.de>
- 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 <werner@suse.de> Mon Oct 22 10:52:10 UTC 2018 - Dr. Werner Fink <werner@suse.de>