Lines 16-27
Link Here
|
16 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
16 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
17 |
*/ |
17 |
*/ |
18 |
|
18 |
|
19 |
#define ustat __kernel_ustat |
|
|
20 |
#include <xfs/libxfs.h> |
19 |
#include <xfs/libxfs.h> |
21 |
#include <mntent.h> |
20 |
#include <mntent.h> |
22 |
#include <sys/stat.h> |
21 |
#include <sys/stat.h> |
23 |
#undef ustat |
|
|
24 |
#include <sys/ustat.h> |
25 |
#include <sys/mount.h> |
22 |
#include <sys/mount.h> |
26 |
#include <sys/ioctl.h> |
23 |
#include <sys/ioctl.h> |
27 |
#include <sys/sysinfo.h> |
24 |
#include <sys/sysinfo.h> |
Lines 49-57
static int max_block_alignment;
Link Here
|
49 |
int |
46 |
int |
50 |
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) |
47 |
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) |
51 |
{ |
48 |
{ |
52 |
/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ |
|
|
53 |
struct ustat ust[2]; |
54 |
struct stat64 st; |
49 |
struct stat64 st; |
|
|
50 |
FILE *f; |
51 |
struct stat64 mst; |
52 |
struct mntent *mnt; |
53 |
char mounts[MAXPATHLEN]; |
54 |
int ismounted = 0; |
55 |
|
55 |
|
56 |
if (!s) { |
56 |
if (!s) { |
57 |
if (stat64(block, &st) < 0) |
57 |
if (stat64(block, &st) < 0) |
Lines 61-74
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
Link Here
|
61 |
s = &st; |
61 |
s = &st; |
62 |
} |
62 |
} |
63 |
|
63 |
|
64 |
if (ustat(s->st_rdev, ust) >= 0) { |
64 |
strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED); |
|
|
65 |
if ((f = setmntent(mounts, "r")) == NULL) |
66 |
return 0; |
67 |
|
68 |
while ((mnt = getmntent(f)) != NULL) { |
69 |
if (stat64(mnt->mnt_dir, &mst) < 0) |
70 |
continue; |
71 |
if (mst.st_dev != s->st_rdev) |
72 |
continue; |
73 |
|
65 |
if (verbose) |
74 |
if (verbose) |
66 |
fprintf(stderr, |
75 |
fprintf(stderr, |
67 |
_("%s: %s contains a mounted filesystem\n"), |
76 |
_("%s: %s contains a mounted filesystem\n"), |
68 |
progname, name); |
77 |
progname, name); |
69 |
return 1; |
78 |
ismounted = 1; |
|
|
79 |
break; |
70 |
} |
80 |
} |
71 |
return 0; |
81 |
endmntent(f); |
|
|
82 |
return ismounted; |
72 |
} |
83 |
} |
73 |
|
84 |
|
74 |
int |
85 |
int |
75 |
-- ./repair/attr_repair.c.orig |
86 |
++ ./repair/attr_repair.c |
Lines 24-29
Link Here
|
24 |
#include "bmap.h" |
24 |
#include "bmap.h" |
25 |
#include "protos.h" |
25 |
#include "protos.h" |
26 |
#include "dir2.h" |
26 |
#include "dir2.h" |
|
|
27 |
#if defined(__linux__) |
28 |
#include <linux/limits.h> |
29 |
#endif |
30 |
|
27 |
|
31 |
|
28 |
static int xfs_acl_valid(struct xfs_mount *mp, struct xfs_acl *daclp); |
32 |
static int xfs_acl_valid(struct xfs_mount *mp, struct xfs_acl *daclp); |
29 |
static int xfs_mac_valid(xfs_mac_label_t *lp); |
33 |
static int xfs_mac_valid(xfs_mac_label_t *lp); |