Gitweb:
http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=e04ac4be...
Commit: e04ac4bed3cf5b2b3376fdcbf4485bc4fa2f2b36
Parent: 0d6743bc762d01ca66867e9cf58692d57fce0317
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Aug 30 11:36:43 2012 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 30 11:54:13 2012 -0500
gfs_controld: fix ignore_nolock for mounted nolock fs
kernel now shows lock_module/proto_name for
lock_nolock, so fix the check.
bz 853180
Signed-off-by: Bob Peterson <rpeterso(a)redhat.com>
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/gfs_controld/util.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/group/gfs_controld/util.c b/group/gfs_controld/util.c
index 440f974..f77f85b 100644
--- a/group/gfs_controld/util.c
+++ b/group/gfs_controld/util.c
@@ -184,7 +184,8 @@ void update_dmsetup_wait(void)
static int ignore_nolock(const char *sysfs_dir, char *table)
{
char path[PATH_MAX];
- int fd;
+ char buf[32];
+ int fd, rv;
memset(path, 0, PATH_MAX);
@@ -198,7 +199,16 @@ static int ignore_nolock(const char *sysfs_dir, char *table)
if (fd < 0)
return 1;
+ memset(buf, 0, sizeof(buf));
+
+ rv = read(fd, buf, sizeof(buf));
close(fd);
+ if (rv < 0)
+ return 1;
+
+ if (!strncmp(buf, "lock_nolock", 11))
+ return 1;
+
return 0;
}