fence-agents: master - fencing: Add information about option that have to be selected from list to XML metadata
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=8fe7e2...
Commit: 8fe7e2ad3d88c9432987c50a49222fcc6d3851f2
Parent: 8c22209121fce621afae6443729896dd8c778ad7
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Nov 20 16:27:50 2013 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Nov 20 16:27:50 2013 +0100
fencing: Add information about option that have to be selected from list to XML metadata
---
fence/agents/lib/fencing.py.py | 7 ++++++-
fence/agents/lib/metadata.rng | 24 ++++++++++++++++++------
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index a19ae20..2b914f2 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -477,7 +477,12 @@ def metadata(avail_opt, options, docs):
mixed = mixed.replace("<", "<").replace(">", ">")
print "\t\t<getopt mixed=\"" + mixed + "\" />"
- if all_opt[option]["getopt"].count(":") > 0:
+ if all_opt[option].has_key("choices"):
+ print "\t\t<content type=\"select\" "+default+" >"
+ for choice in all_opt[option]["choices"]:
+ print "\t\t\t<option value=\"%s\" />" % (choice)
+ print "\t\t</content>"
+ elif all_opt[option]["getopt"].count(":") > 0:
print "\t\t<content type=\"string\" "+default+" />"
else:
print "\t\t<content type=\"boolean\" "+default+" />"
diff --git a/fence/agents/lib/metadata.rng b/fence/agents/lib/metadata.rng
index 2566fee..c7758e6 100644
--- a/fence/agents/lib/metadata.rng
+++ b/fence/agents/lib/metadata.rng
@@ -24,12 +24,24 @@
<attribute name="mixed" />
</element>
<element name="content">
- <attribute name="type">
- <choice>
- <value>boolean</value>
- <value>string</value>
- </choice>
- </attribute>
+ <choice>
+ <attribute name="type">
+ <choice>
+ <value>boolean</value>
+ <value>string</value>
+ </choice>
+ </attribute>
+ <group>
+ <attribute name="type">
+ <value>select</value>
+ </attribute>
+ <zeroOrMore>
+ <element name="option">
+ <attribute name="value" />
+ </element>
+ </zeroOrMore>
+ </group>
+ </choice>
<optional>
<attribute name="default"> <text /> </attribute>
</optional>
10 years, 5 months
fence-agents: master - fencing: Add support for options which should be selected from a list of values
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=8c2220...
Commit: 8c22209121fce621afae6443729896dd8c778ad7
Parent: 2715fa56b7da91dcc9c0e7114bb4928b8896bbbf
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Nov 20 16:02:32 2013 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Nov 20 16:02:32 2013 +0100
fencing: Add support for options which should be selected from a list of values
Previously, we have supported only strings and booleans; this is first patch that adds
support for entering constrains like select a proper SNMP version from [1, 2c, 3].
---
fence/agents/drac5/fence_drac5.py | 1 +
fence/agents/lib/fencing.py.py | 20 +++++++++++++-------
fence/agents/lpar/fence_lpar.py | 4 +---
3 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/fence/agents/drac5/fence_drac5.py b/fence/agents/drac5/fence_drac5.py
index aa432c2..2c067a7 100644
--- a/fence/agents/drac5/fence_drac5.py
+++ b/fence/agents/drac5/fence_drac5.py
@@ -96,6 +96,7 @@ def define_new_opts():
"help" : "-d, --drac-version=[version] Force DRAC version to use (DRAC 5, DRAC CMC, DRAC MC)",
"required" : "0",
"shortdesc" : "Force DRAC version to use (DRAC 5, DRAC CMC, DRAC MC)",
+ "choices" : [ "DRAC CMC", "DRAC MC", "DRAC 5" ],
"order" : 1 }
def main():
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 0ef0934..a19ae20 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -142,13 +142,6 @@ all_opt = {
"required" : "0",
"shortdesc" : "Identity file for ssh",
"order" : 1 },
- "drac_version" : {
- "getopt" : "d:",
- "longopt" : "drac-version",
- "help" : "-d, --drac-version=[version] Force DRAC version to use",
- "required" : "0",
- "shortdesc" : "Force DRAC version to use",
- "order" : 1 },
"cmd_prompt" : {
"getopt" : "c:",
"longopt" : "command-prompt",
@@ -219,6 +212,7 @@ all_opt = {
"help" : "-d, --snmp-version=[version] Specifies SNMP version to use",
"required" : "0",
"shortdesc" : "Specifies SNMP version to use (1,2c,3)",
+ "choices" : [ "1", "2c", "3" ],
"order" : 1 },
"community" : {
"getopt" : "c:",
@@ -233,6 +227,7 @@ all_opt = {
"help" : "-b, --snmp-auth-prot=[prot] Set authentication protocol (MD5|SHA)",
"required" : "0",
"shortdesc" : "Set authentication protocol (MD5|SHA)",
+ "choices" : [ "MD5" , "SHA" ],
"order" : 1},
"snmp_sec_level" : {
"getopt" : "E:",
@@ -241,6 +236,7 @@ all_opt = {
" (noAuthNoPriv|authNoPriv|authPriv)",
"required" : "0",
"shortdesc" : "Set security level (noAuthNoPriv|authNoPriv|authPriv)",
+ "choices" : [ "noAuthNoPriv", "authNoPriv", "authPriv" ],
"order" : 1},
"snmp_priv_prot" : {
"getopt" : "B:",
@@ -248,6 +244,7 @@ all_opt = {
"help" : "-B, --snmp-priv-prot=[prot] Set privacy protocol (DES|AES)",
"required" : "0",
"shortdesc" : "Set privacy protocol (DES|AES)",
+ "choices" : [ "DES", "AES" ],
"order" : 1},
"snmp_priv_passwd" : {
"getopt" : "P:",
@@ -721,6 +718,15 @@ def check_input(device_opt, opt):
else:
options["--ipport"] = 23
+ for opt in device_opt:
+ if all_opt[opt].has_key("choices"):
+ long = "--" + all_opt[opt]["longopt"]
+ possible_values_upper = map (lambda y : y.upper(), all_opt[opt]["choices"])
+ if options.has_key(long):
+ options[long] = options[long].upper()
+ if not options["--" + all_opt[opt]["longopt"]] in possible_values_upper:
+ fail_usage("Failed: You have to enter a valid choice for %s from the valid values: %s" % ("--" + all_opt[opt]["longopt"] , str(all_opt[opt]["choices"])))
+
return options
def wait_power_status(tn, options, get_power_fn):
diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py
index 6d2c649..1d7e09c 100644
--- a/fence/agents/lpar/fence_lpar.py
+++ b/fence/agents/lpar/fence_lpar.py
@@ -114,6 +114,7 @@ def define_new_opts():
"required" : "0",
"shortdesc" : "Force HMC version to use (3 or 4)",
"default" : "4",
+ "choices" : [ "3", "4" ],
"order" : 1 }
def main():
@@ -139,9 +140,6 @@ def main():
if 0 == options.has_key("--managed"):
fail_usage("Failed: You have to enter name of managed system")
- if 1 == options.has_key("--hmc-version") and (options["--hmc-version"] != "3" and options["--hmc-version"] != "4"):
- fail_usage("Failed: You have to enter valid version number: 3 or 4")
-
##
## Operate the fencing device
####
10 years, 5 months
gfs2-utils: RHEL7 - libgfs2: Remove is_pathname_mounted
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=0d5b21ad...
Commit: 0d5b21adc867da3c738474ec2bcd1cfa625f8bb6
Parent: 63bd2eff2043c2d14399d5511e116ae0cdd8bba3
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:21:36 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Mon Nov 18 10:50:14 2013 +0000
libgfs2: Remove is_pathname_mounted
All callers are now using lgfs2_open_mnt* instead.
Resolves: bz#991204
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/libgfs2/misc.c | 61 ------------------------------------------------
2 files changed, 0 insertions(+), 62 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3e5d09c..e785017 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -715,7 +715,6 @@ extern int metafs_interrupted;
extern int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
extern int compute_constants(struct gfs2_sbd *sdp);
-extern int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount);
extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 195b983..c4ed722 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -102,67 +102,6 @@ int compute_constants(struct gfs2_sbd *sdp)
return 0;
}
-int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount)
-{
- FILE *fp;
- struct mntent *mnt;
- dev_t file_dev=0, file_rdev=0;
- ino_t file_ino=0;
- struct stat st_buf;
-
- *ro_mount = 0;
- if ((fp = setmntent("/proc/mounts", "r")) == NULL) {
- perror("open: /proc/mounts");
- return 0;
- }
- if (stat(path_name, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
- file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
- } else {
- file_dev = st_buf.st_dev;
- file_ino = st_buf.st_ino;
- }
- }
- while ((mnt = getmntent (fp)) != NULL) {
- /* Check if they specified the device instead of mnt point */
- if (strcmp(device_name, mnt->mnt_fsname) == 0) {
- strcpy(path_name, mnt->mnt_dir); /* fix it */
- break;
- }
- if (strcmp(path_name, mnt->mnt_dir) == 0) {
- strcpy(device_name, mnt->mnt_fsname); /* fix it */
- break;
- }
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
- }
- }
- }
- endmntent (fp);
- if (mnt == NULL)
- return 0;
- if (stat(mnt->mnt_dir, &st_buf) < 0) {
- if (errno == ENOENT)
- return 0;
- }
- /* Can't trust fstype because / has "rootfs". */
- if (file_rdev && (st_buf.st_dev != file_rdev))
- return 0;
- if (hasmntopt(mnt, MNTOPT_RO))
- *ro_mount = 1;
- return 1; /* mounted */
-}
-
/* Returns 0 if fd1 and fd2 refer to the same device/file, 1 otherwise, or -1 on error */
static int fdcmp(int fd1, int fd2)
{
10 years, 5 months
gfs2-utils: RHEL7 - Switch is_pathname_mounted callers to lgfs2_open_mnt*
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=63bd2eff...
Commit: 63bd2eff2043c2d14399d5511e116ae0cdd8bba3
Parent: 3c8db52fe77267109a6f01c178370747a23e64fd
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:19:07 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Mon Nov 18 10:49:49 2013 +0000
Switch is_pathname_mounted callers to lgfs2_open_mnt*
Use the new lgfs2_open_mnt* functions in fsck.gfs2, gfs2_grow, and gfs2_jadd.
Resolves: bz#991204
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/initialize.c | 30 ++++++++++++------------------
gfs2/mkfs/main_grow.c | 31 ++++++++++++-------------------
gfs2/mkfs/main_jadd.c | 17 +++++++++--------
3 files changed, 33 insertions(+), 45 deletions(-)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 6612fe7..5758607 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1475,8 +1475,7 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
sdp->device_fd = open(opts.device, open_flag);
if (sdp->device_fd < 0) {
- int is_mounted, ro;
-
+ struct mntent *mnt;
if (open_flag == O_RDONLY || errno != EBUSY) {
log_crit( _("Unable to open device: %s\n"),
opts.device);
@@ -1485,30 +1484,23 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
/* We can't open it EXCL. It may be already open rw (in which
case we want to deny them access) or it may be mounted as
the root file system at boot time (in which case we need to
- allow it.) We use is_pathname_mounted here even though
- we're specifying a device name, not a path name. The
- function checks for device as well. */
- strncpy(sdp->device_name, opts.device,
- sizeof(sdp->device_name));
- sdp->path_name = sdp->device_name; /* This gets overwritten */
- is_mounted = is_pathname_mounted(sdp->path_name, sdp->device_name, &ro);
- /* If the device is busy, but not because it's mounted, fail.
+ allow it.)
+ If the device is busy, but not because it's mounted, fail.
This protects against cases where the file system is LVM
- and perhaps mounted on a different node. */
- if (!is_mounted)
+ and perhaps mounted on a different node.
+ Try opening without O_EXCL. */
+ sdp->device_fd = lgfs2_open_mnt_dev(opts.device, O_RDWR, &mnt);
+ if (sdp->device_fd < 0)
goto mount_fail;
/* If the device is mounted, but not mounted RO, fail. This
protects them against cases where the file system is
mounted RW, but still allows us to check our own root
file system. */
- if (!ro)
- goto mount_fail;
+ if (!hasmntopt(mnt, MNTOPT_RO))
+ goto close_fail;
/* The device is mounted RO, so it's likely our own root
file system. We can only do so much to protect the users
- from themselves. Try opening without O_EXCL. */
- if ((sdp->device_fd = open(opts.device, O_RDWR)) < 0)
- goto mount_fail;
-
+ from themselves. */
was_mounted_ro = 1;
}
@@ -1591,6 +1583,8 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
return FSCK_OK;
+close_fail:
+ close(sdp->device_fd);
mount_fail:
log_crit( _("Device %s is busy.\n"), opts.device);
return FSCK_USAGE;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 5db91d9..541b0f2 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -323,7 +323,7 @@ main_grow(int argc, char *argv[])
int rgcount, rindex_fd;
char rindex_name[PATH_MAX];
int error = EXIT_SUCCESS;
- int ro_mnt = 0;
+ int devflags = (test ? O_RDONLY : O_RDWR) | O_CLOEXEC;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->bsize = GFS2_DEFAULT_BSIZE;
@@ -333,30 +333,23 @@ main_grow(int argc, char *argv[])
sdp->md.journals = 1;
decode_arguments(argc, argv, sdp);
- while ((argc - optind) > 0) {
+ for(; (argc - optind) > 0; optind++) {
int sane;
+ struct mntent *mnt;
struct rgrp_tree *last_rgrp;
- strncpy(sdp->device_name, argv[optind], PATH_MAX - 1);
- sdp->path_name = argv[optind++];
-
- if ((!is_pathname_mounted(sdp->path_name, sdp->device_name, &ro_mnt))) {
- perror(sdp->path_name);
- exit(EXIT_FAILURE);
- }
-
- sdp->path_fd = open(sdp->path_name, O_RDONLY | O_CLOEXEC);
- if (sdp->path_fd < 0){
- perror(sdp->path_name);
+ error = lgfs2_open_mnt(argv[optind], O_RDONLY|O_CLOEXEC, &sdp->path_fd,
+ devflags, &sdp->device_fd, &mnt);
+ if (error != 0) {
+ fprintf(stderr, _("Error looking up mount '%s': %s\n"), argv[optind], strerror(errno));
exit(EXIT_FAILURE);
}
-
- sdp->device_fd = open(sdp->device_name,
- (test ? O_RDONLY : O_RDWR) | O_CLOEXEC);
- if (sdp->device_fd < 0){
- perror(sdp->device_name);
- exit(EXIT_FAILURE);
+ if (mnt == NULL) {
+ fprintf(stderr, _("%s: not a mounted gfs2 file system\n"), argv[optind]);
+ continue;
}
+ sdp->path_name = mnt->mnt_dir;
+ strncpy(sdp->device_name, mnt->mnt_fsname, PATH_MAX - 1);
if (lgfs2_get_dev_info(sdp->device_fd, &sdp->dinfo) < 0) {
perror(sdp->device_name);
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index b6cd8e4..815dd52 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -490,8 +490,8 @@ add_j(struct gfs2_sbd *sdp)
void main_jadd(int argc, char *argv[])
{
struct gfs2_sbd sbd, *sdp = &sbd;
+ struct mntent *mnt;
unsigned int total;
- int ro_mnt = 0;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->jsize = GFS2_DEFAULT_JSIZE;
@@ -500,17 +500,18 @@ void main_jadd(int argc, char *argv[])
decode_arguments(argc, argv, sdp);
verify_arguments(sdp);
-
- sdp->path_fd = open(sdp->path_name, O_RDONLY | O_CLOEXEC);
- if (sdp->path_fd < 0){
- perror(sdp->path_name);
+
+ sbd.path_fd = lgfs2_open_mnt_dir(sbd.path_name, O_RDONLY|O_CLOEXEC, &mnt);
+ if (sbd.path_fd < 0) {
+ fprintf(stderr, _("Error looking up mount '%s': %s\n"), sbd.path_name, strerror(errno));
exit(EXIT_FAILURE);
}
-
- if (!is_pathname_mounted(sdp->path_name, sdp->device_name, &ro_mnt)) {
- perror(sdp->path_name);
+ if (mnt == NULL) {
+ fprintf(stderr, _("%s: not a mounted gfs2 file system\n"), sbd.path_name);
exit(EXIT_FAILURE);
}
+ sbd.path_name = mnt->mnt_dir;
+ strncpy(sbd.device_name, mnt->mnt_fsname, PATH_MAX - 1);
gather_info(sdp);
10 years, 5 months
gfs2-utils: RHEL7 - libgfs2: Add lgfs2_open_mnt* functions
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=3c8db52f...
Commit: 3c8db52fe77267109a6f01c178370747a23e64fd
Parent: 5e4fe097ac39ceb8e6768da98cd1e84ff99b8176
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:10:52 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Mon Nov 18 10:48:55 2013 +0000
libgfs2: Add lgfs2_open_mnt* functions
lgfs2_open_mnt is a replacement for is_pathname_mounted which tries to reduce
races by opening paths speculatively and passing back the open fds once they're
known to be correct. lgfs2_open_mnt_{dev,dir} build on this to provide a
convenient way to open just the device or mount directory relating to a path
which could be either.
Resolves: bz#991204
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 4 ++
gfs2/libgfs2/misc.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index f864a08..3e5d09c 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -12,6 +12,7 @@
#include <linux/limits.h>
#include <endian.h>
#include <byteswap.h>
+#include <mntent.h>
#include <linux/gfs2_ondisk.h>
#include "osi_list.h"
@@ -715,6 +716,9 @@ extern int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
extern int compute_constants(struct gfs2_sbd *sdp);
extern int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount);
+extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
+extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
+extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
extern int find_gfs2_meta(struct gfs2_sbd *sdp);
extern int dir_exists(const char *dir);
extern int mount_gfs2_meta(struct gfs2_sbd *sdp);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 7f500e6..195b983 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -163,6 +163,100 @@ int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount)
return 1; /* mounted */
}
+/* Returns 0 if fd1 and fd2 refer to the same device/file, 1 otherwise, or -1 on error */
+static int fdcmp(int fd1, int fd2)
+{
+ struct stat st1, st2;
+ if ((fstat(fd1, &st1) != 0) || (fstat(fd2, &st2) != 0))
+ return -1;
+ if (S_ISBLK(st1.st_mode) && S_ISBLK(st2.st_mode)) {
+ if (st1.st_rdev == st2.st_rdev) {
+ return 0;
+ }
+ } else if ((st1.st_dev == st2.st_dev) && (st1.st_ino == st2.st_ino)) {
+ return 0;
+ }
+ return 1;
+}
+
+int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt)
+{
+ FILE *fp = setmntent("/proc/mounts", "r");
+ if (fp == NULL) {
+ perror("open: /proc/mounts");
+ return 1;
+ }
+ /* Assume path is mount point until we know better. */
+ *dirfd = open(path, dirflags);
+ if (*dirfd < 0)
+ return 1;
+
+ while ((*mnt = getmntent(fp)) != NULL) {
+ int fd;
+ if (strcmp((*mnt)->mnt_type, "gfs2") != 0)
+ continue;
+ *devfd = open((*mnt)->mnt_fsname, devflags);
+ /* Defer checking *devfd until later: whether it's ok to ignore
+ * the error depends on whether we find the mount point. */
+
+ if (strcmp(path, (*mnt)->mnt_dir) == 0)
+ break;
+ if (strcmp(path, (*mnt)->mnt_fsname) == 0 || fdcmp(*dirfd, *devfd) == 0) {
+ /* We have a match but our above assumption was
+ incorrect and *dirfd is actually the device. */
+ close(*dirfd);
+ *dirfd = open((*mnt)->mnt_dir, dirflags);
+ break;
+ }
+
+ fd = open((*mnt)->mnt_dir, dirflags);
+ if (fd >= 0) {
+ int diff = fdcmp(*dirfd, fd);
+ close(fd);
+ if (diff == 0)
+ break;
+ }
+ if (*devfd >= 0)
+ close(*devfd);
+ }
+ endmntent(fp);
+ if (*mnt == NULL) {
+ close(*dirfd);
+ return 0; /* Success. Answer is no. Both fds closed. */
+ }
+ if (*dirfd < 0) {
+ close(*devfd);
+ return 1;
+ }
+ if (*devfd < 0) {
+ close(*dirfd);
+ return 1;
+ }
+ return 0; /* Success. Answer is yes. Both fds open. */
+}
+
+int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt)
+{
+ int dirfd = -1;
+ int devfd = -1;
+ if (lgfs2_open_mnt(path, O_RDONLY, &dirfd, flags, &devfd, mnt) != 0)
+ return -1;
+ if (*mnt != NULL)
+ close(dirfd);
+ return devfd;
+}
+
+int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt)
+{
+ int dirfd = -1;
+ int devfd = -1;
+ if (lgfs2_open_mnt(path, flags, &dirfd, O_RDONLY, &devfd, mnt) != 0)
+ return -1;
+ if (*mnt != NULL)
+ close(devfd);
+ return dirfd;
+}
+
static int lock_for_admin(struct gfs2_sbd *sdp)
{
int error;
10 years, 5 months
gfs2-utils: master - libgfs2: Remove is_pathname_mounted
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=63db4e96...
Commit: 63db4e964739673d36c430cc5c78b02d93419f8a
Parent: ad11e277ebd8d01a1b0a29ee9f697ba90c8577a4
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:21:36 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Sat Nov 16 02:21:36 2013 -0600
libgfs2: Remove is_pathname_mounted
All callers are now using lgfs2_open_mnt* instead.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 1 -
gfs2/libgfs2/misc.c | 61 ------------------------------------------------
2 files changed, 0 insertions(+), 62 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 3e5d09c..e785017 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -715,7 +715,6 @@ extern int metafs_interrupted;
extern int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
extern int compute_constants(struct gfs2_sbd *sdp);
-extern int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount);
extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 195b983..c4ed722 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -102,67 +102,6 @@ int compute_constants(struct gfs2_sbd *sdp)
return 0;
}
-int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount)
-{
- FILE *fp;
- struct mntent *mnt;
- dev_t file_dev=0, file_rdev=0;
- ino_t file_ino=0;
- struct stat st_buf;
-
- *ro_mount = 0;
- if ((fp = setmntent("/proc/mounts", "r")) == NULL) {
- perror("open: /proc/mounts");
- return 0;
- }
- if (stat(path_name, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
- file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
- } else {
- file_dev = st_buf.st_dev;
- file_ino = st_buf.st_ino;
- }
- }
- while ((mnt = getmntent (fp)) != NULL) {
- /* Check if they specified the device instead of mnt point */
- if (strcmp(device_name, mnt->mnt_fsname) == 0) {
- strcpy(path_name, mnt->mnt_dir); /* fix it */
- break;
- }
- if (strcmp(path_name, mnt->mnt_dir) == 0) {
- strcpy(device_name, mnt->mnt_fsname); /* fix it */
- break;
- }
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
- }
- }
- }
- endmntent (fp);
- if (mnt == NULL)
- return 0;
- if (stat(mnt->mnt_dir, &st_buf) < 0) {
- if (errno == ENOENT)
- return 0;
- }
- /* Can't trust fstype because / has "rootfs". */
- if (file_rdev && (st_buf.st_dev != file_rdev))
- return 0;
- if (hasmntopt(mnt, MNTOPT_RO))
- *ro_mount = 1;
- return 1; /* mounted */
-}
-
/* Returns 0 if fd1 and fd2 refer to the same device/file, 1 otherwise, or -1 on error */
static int fdcmp(int fd1, int fd2)
{
10 years, 5 months
gfs2-utils: master - Switch is_pathname_mounted callers to lgfs2_open_mnt*
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=ad11e277...
Commit: ad11e277ebd8d01a1b0a29ee9f697ba90c8577a4
Parent: 25c6e51bb4d083eb341bbc8541bb2ad278988f10
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:19:07 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Sat Nov 16 02:19:07 2013 -0600
Switch is_pathname_mounted callers to lgfs2_open_mnt*
Use the new lgfs2_open_mnt* functions in fsck.gfs2, gfs2_grow, and gfs2_jadd.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/initialize.c | 30 ++++++++++++------------------
gfs2/mkfs/main_grow.c | 31 ++++++++++++-------------------
gfs2/mkfs/main_jadd.c | 17 +++++++++--------
3 files changed, 33 insertions(+), 45 deletions(-)
diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c
index 6612fe7..5758607 100644
--- a/gfs2/fsck/initialize.c
+++ b/gfs2/fsck/initialize.c
@@ -1475,8 +1475,7 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
sdp->device_fd = open(opts.device, open_flag);
if (sdp->device_fd < 0) {
- int is_mounted, ro;
-
+ struct mntent *mnt;
if (open_flag == O_RDONLY || errno != EBUSY) {
log_crit( _("Unable to open device: %s\n"),
opts.device);
@@ -1485,30 +1484,23 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
/* We can't open it EXCL. It may be already open rw (in which
case we want to deny them access) or it may be mounted as
the root file system at boot time (in which case we need to
- allow it.) We use is_pathname_mounted here even though
- we're specifying a device name, not a path name. The
- function checks for device as well. */
- strncpy(sdp->device_name, opts.device,
- sizeof(sdp->device_name));
- sdp->path_name = sdp->device_name; /* This gets overwritten */
- is_mounted = is_pathname_mounted(sdp->path_name, sdp->device_name, &ro);
- /* If the device is busy, but not because it's mounted, fail.
+ allow it.)
+ If the device is busy, but not because it's mounted, fail.
This protects against cases where the file system is LVM
- and perhaps mounted on a different node. */
- if (!is_mounted)
+ and perhaps mounted on a different node.
+ Try opening without O_EXCL. */
+ sdp->device_fd = lgfs2_open_mnt_dev(opts.device, O_RDWR, &mnt);
+ if (sdp->device_fd < 0)
goto mount_fail;
/* If the device is mounted, but not mounted RO, fail. This
protects them against cases where the file system is
mounted RW, but still allows us to check our own root
file system. */
- if (!ro)
- goto mount_fail;
+ if (!hasmntopt(mnt, MNTOPT_RO))
+ goto close_fail;
/* The device is mounted RO, so it's likely our own root
file system. We can only do so much to protect the users
- from themselves. Try opening without O_EXCL. */
- if ((sdp->device_fd = open(opts.device, O_RDWR)) < 0)
- goto mount_fail;
-
+ from themselves. */
was_mounted_ro = 1;
}
@@ -1591,6 +1583,8 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen,
return FSCK_OK;
+close_fail:
+ close(sdp->device_fd);
mount_fail:
log_crit( _("Device %s is busy.\n"), opts.device);
return FSCK_USAGE;
diff --git a/gfs2/mkfs/main_grow.c b/gfs2/mkfs/main_grow.c
index 5db91d9..541b0f2 100644
--- a/gfs2/mkfs/main_grow.c
+++ b/gfs2/mkfs/main_grow.c
@@ -323,7 +323,7 @@ main_grow(int argc, char *argv[])
int rgcount, rindex_fd;
char rindex_name[PATH_MAX];
int error = EXIT_SUCCESS;
- int ro_mnt = 0;
+ int devflags = (test ? O_RDONLY : O_RDWR) | O_CLOEXEC;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->bsize = GFS2_DEFAULT_BSIZE;
@@ -333,30 +333,23 @@ main_grow(int argc, char *argv[])
sdp->md.journals = 1;
decode_arguments(argc, argv, sdp);
- while ((argc - optind) > 0) {
+ for(; (argc - optind) > 0; optind++) {
int sane;
+ struct mntent *mnt;
struct rgrp_tree *last_rgrp;
- strncpy(sdp->device_name, argv[optind], PATH_MAX - 1);
- sdp->path_name = argv[optind++];
-
- if ((!is_pathname_mounted(sdp->path_name, sdp->device_name, &ro_mnt))) {
- perror(sdp->path_name);
- exit(EXIT_FAILURE);
- }
-
- sdp->path_fd = open(sdp->path_name, O_RDONLY | O_CLOEXEC);
- if (sdp->path_fd < 0){
- perror(sdp->path_name);
+ error = lgfs2_open_mnt(argv[optind], O_RDONLY|O_CLOEXEC, &sdp->path_fd,
+ devflags, &sdp->device_fd, &mnt);
+ if (error != 0) {
+ fprintf(stderr, _("Error looking up mount '%s': %s\n"), argv[optind], strerror(errno));
exit(EXIT_FAILURE);
}
-
- sdp->device_fd = open(sdp->device_name,
- (test ? O_RDONLY : O_RDWR) | O_CLOEXEC);
- if (sdp->device_fd < 0){
- perror(sdp->device_name);
- exit(EXIT_FAILURE);
+ if (mnt == NULL) {
+ fprintf(stderr, _("%s: not a mounted gfs2 file system\n"), argv[optind]);
+ continue;
}
+ sdp->path_name = mnt->mnt_dir;
+ strncpy(sdp->device_name, mnt->mnt_fsname, PATH_MAX - 1);
if (lgfs2_get_dev_info(sdp->device_fd, &sdp->dinfo) < 0) {
perror(sdp->device_name);
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index b6cd8e4..815dd52 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -490,8 +490,8 @@ add_j(struct gfs2_sbd *sdp)
void main_jadd(int argc, char *argv[])
{
struct gfs2_sbd sbd, *sdp = &sbd;
+ struct mntent *mnt;
unsigned int total;
- int ro_mnt = 0;
memset(sdp, 0, sizeof(struct gfs2_sbd));
sdp->jsize = GFS2_DEFAULT_JSIZE;
@@ -500,17 +500,18 @@ void main_jadd(int argc, char *argv[])
decode_arguments(argc, argv, sdp);
verify_arguments(sdp);
-
- sdp->path_fd = open(sdp->path_name, O_RDONLY | O_CLOEXEC);
- if (sdp->path_fd < 0){
- perror(sdp->path_name);
+
+ sbd.path_fd = lgfs2_open_mnt_dir(sbd.path_name, O_RDONLY|O_CLOEXEC, &mnt);
+ if (sbd.path_fd < 0) {
+ fprintf(stderr, _("Error looking up mount '%s': %s\n"), sbd.path_name, strerror(errno));
exit(EXIT_FAILURE);
}
-
- if (!is_pathname_mounted(sdp->path_name, sdp->device_name, &ro_mnt)) {
- perror(sdp->path_name);
+ if (mnt == NULL) {
+ fprintf(stderr, _("%s: not a mounted gfs2 file system\n"), sbd.path_name);
exit(EXIT_FAILURE);
}
+ sbd.path_name = mnt->mnt_dir;
+ strncpy(sbd.device_name, mnt->mnt_fsname, PATH_MAX - 1);
gather_info(sdp);
10 years, 5 months
gfs2-utils: master - libgfs2: Add lgfs2_open_mnt* functions
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=25c6e51b...
Commit: 25c6e51bb4d083eb341bbc8541bb2ad278988f10
Parent: 24bc0bf2ba3c4cdb125555e07af96b52a2a5dea1
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat Nov 16 02:10:52 2013 -0600
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Sat Nov 16 02:10:52 2013 -0600
libgfs2: Add lgfs2_open_mnt* functions
lgfs2_open_mnt is a replacement for is_pathname_mounted which tries to reduce
races by opening paths speculatively and passing back the open fds once they're
known to be correct. lgfs2_open_mnt_{dev,dir} build on this to provide a
convenient way to open just the device or mount directory relating to a path
which could be either.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/libgfs2.h | 4 ++
gfs2/libgfs2/misc.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index f864a08..3e5d09c 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -12,6 +12,7 @@
#include <linux/limits.h>
#include <endian.h>
#include <byteswap.h>
+#include <mntent.h>
#include <linux/gfs2_ondisk.h>
#include "osi_list.h"
@@ -715,6 +716,9 @@ extern int compute_heightsize(struct gfs2_sbd *sdp, uint64_t *heightsize,
uint32_t *maxheight, uint32_t bsize1, int diptrs, int inptrs);
extern int compute_constants(struct gfs2_sbd *sdp);
extern int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount);
+extern int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt);
+extern int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt);
+extern int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt);
extern int find_gfs2_meta(struct gfs2_sbd *sdp);
extern int dir_exists(const char *dir);
extern int mount_gfs2_meta(struct gfs2_sbd *sdp);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 7f500e6..195b983 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -163,6 +163,100 @@ int is_pathname_mounted(char *path_name, char *device_name, int *ro_mount)
return 1; /* mounted */
}
+/* Returns 0 if fd1 and fd2 refer to the same device/file, 1 otherwise, or -1 on error */
+static int fdcmp(int fd1, int fd2)
+{
+ struct stat st1, st2;
+ if ((fstat(fd1, &st1) != 0) || (fstat(fd2, &st2) != 0))
+ return -1;
+ if (S_ISBLK(st1.st_mode) && S_ISBLK(st2.st_mode)) {
+ if (st1.st_rdev == st2.st_rdev) {
+ return 0;
+ }
+ } else if ((st1.st_dev == st2.st_dev) && (st1.st_ino == st2.st_ino)) {
+ return 0;
+ }
+ return 1;
+}
+
+int lgfs2_open_mnt(const char *path, int dirflags, int *dirfd, int devflags, int *devfd, struct mntent **mnt)
+{
+ FILE *fp = setmntent("/proc/mounts", "r");
+ if (fp == NULL) {
+ perror("open: /proc/mounts");
+ return 1;
+ }
+ /* Assume path is mount point until we know better. */
+ *dirfd = open(path, dirflags);
+ if (*dirfd < 0)
+ return 1;
+
+ while ((*mnt = getmntent(fp)) != NULL) {
+ int fd;
+ if (strcmp((*mnt)->mnt_type, "gfs2") != 0)
+ continue;
+ *devfd = open((*mnt)->mnt_fsname, devflags);
+ /* Defer checking *devfd until later: whether it's ok to ignore
+ * the error depends on whether we find the mount point. */
+
+ if (strcmp(path, (*mnt)->mnt_dir) == 0)
+ break;
+ if (strcmp(path, (*mnt)->mnt_fsname) == 0 || fdcmp(*dirfd, *devfd) == 0) {
+ /* We have a match but our above assumption was
+ incorrect and *dirfd is actually the device. */
+ close(*dirfd);
+ *dirfd = open((*mnt)->mnt_dir, dirflags);
+ break;
+ }
+
+ fd = open((*mnt)->mnt_dir, dirflags);
+ if (fd >= 0) {
+ int diff = fdcmp(*dirfd, fd);
+ close(fd);
+ if (diff == 0)
+ break;
+ }
+ if (*devfd >= 0)
+ close(*devfd);
+ }
+ endmntent(fp);
+ if (*mnt == NULL) {
+ close(*dirfd);
+ return 0; /* Success. Answer is no. Both fds closed. */
+ }
+ if (*dirfd < 0) {
+ close(*devfd);
+ return 1;
+ }
+ if (*devfd < 0) {
+ close(*dirfd);
+ return 1;
+ }
+ return 0; /* Success. Answer is yes. Both fds open. */
+}
+
+int lgfs2_open_mnt_dev(const char *path, int flags, struct mntent **mnt)
+{
+ int dirfd = -1;
+ int devfd = -1;
+ if (lgfs2_open_mnt(path, O_RDONLY, &dirfd, flags, &devfd, mnt) != 0)
+ return -1;
+ if (*mnt != NULL)
+ close(dirfd);
+ return devfd;
+}
+
+int lgfs2_open_mnt_dir(const char *path, int flags, struct mntent **mnt)
+{
+ int dirfd = -1;
+ int devfd = -1;
+ if (lgfs2_open_mnt(path, flags, &dirfd, O_RDONLY, &devfd, mnt) != 0)
+ return -1;
+ if (*mnt != NULL)
+ close(devfd);
+ return dirfd;
+}
+
static int lock_for_admin(struct gfs2_sbd *sdp)
{
int error;
10 years, 5 months
dlm: master - dlm.conf: specify file location
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=dlm.git;a=commitdiff;h=3b7e2402912517f...
Commit: 3b7e2402912517fae49e03f98bdba61bb5873415
Parent: 102d3c248c59f8f36a9d5088afd4eed787583e04
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Nov 13 14:11:53 2013 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Nov 13 14:11:53 2013 -0600
dlm.conf: specify file location
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
dlm_controld/dlm.conf.5 | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlm_controld/dlm.conf.5 b/dlm_controld/dlm.conf.5
index 793435a..007e4de 100644
--- a/dlm_controld/dlm.conf.5
+++ b/dlm_controld/dlm.conf.5
@@ -3,6 +3,9 @@
.SH NAME
dlm.conf \- dlm_controld configuration file
+.SH SYNOPSIS
+.B /etc/dlm/dlm.conf
+
.SH DESCRIPTION
The configuration options in dlm.conf mirror the dlm_controld
command line options. The config file additionally allows
10 years, 5 months
gfs2-utils: RHEL7 - gfs2l: Build with -D_FILE_OFFSET_BITS=64
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=5e4fe097...
Commit: 5e4fe097ac39ceb8e6768da98cd1e84ff99b8176
Parent: 32d72eb22fdf00c759df50e5fce49292d15be5ed
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Nov 12 16:38:34 2013 +0000
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Nov 12 17:26:00 2013 +0000
gfs2l: Build with -D_FILE_OFFSET_BITS=64
The latest test cases were failing on 32-bit architectures as gfs2l
wasn't being built with large file support. This adds
-D_FILE_OFFSET_BITS=64 to fix the tests.
Resolves: bz#1028388
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/libgfs2/Makefile.am b/gfs2/libgfs2/Makefile.am
index b57f6d9..c5cb288 100644
--- a/gfs2/libgfs2/Makefile.am
+++ b/gfs2/libgfs2/Makefile.am
@@ -22,7 +22,7 @@ libgfs2_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 \
-I$(top_srcdir)/gfs2/include
gfs2l_SOURCES = gfs2l.c
-gfs2l_CPPFLAGS = -I$(top_srcdir)/gfs2/include
+gfs2l_CPPFLAGS = -I$(top_srcdir)/gfs2/include -D_FILE_OFFSET_BITS=64
gfs2l_LDADD = libgfs2.la
# Autotools can't handle header files output by flex so we have to generate it manually
10 years, 5 months