Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 149854 Details for
Bug 228540
Need to add gfs2_tool lockdump support to gfs2
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for gfs2_tool to use the new kernel feature
228540.tool.patch.try1 (text/plain), 2.86 KB, created by
Robert Peterson
on 2007-03-12 19:08:27 UTC
(
hide
)
Description:
Patch for gfs2_tool to use the new kernel feature
Filename:
MIME Type:
Creator:
Robert Peterson
Created:
2007-03-12 19:08:27 UTC
Size:
2.86 KB
patch
obsolete
>Index: gfs2_tool.h >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/gfs2_tool.h,v >retrieving revision 1.5 >diff -w -u -p -p -u -r1.5 gfs2_tool.h >--- gfs2_tool.h 13 Oct 2005 16:39:19 -0000 1.5 >+++ gfs2_tool.h 12 Mar 2007 18:46:43 -0000 >@@ -95,6 +95,7 @@ void set_tune(int argc, char **argv); > void check_for_gfs2(int fd, char *path); > char *get_list(void); > char **str2lines(char *str); >+const char *find_debugfs_mount(void); > char *mp2fsname(char *mp); > char *name2value(char *str, char *name); > uint32_t name2u32(char *str, char *name); >Index: misc.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/misc.c,v >retrieving revision 1.8 >diff -w -u -p -p -u -r1.8 misc.c >--- misc.c 26 Oct 2006 18:42:25 -0000 1.8 >+++ misc.c 12 Mar 2007 18:46:44 -0000 >@@ -32,6 +32,8 @@ > > #include "gfs2_tool.h" > >+#define BUFFER_SIZE (4096) >+ > #if GFS2_TOOL_FEATURE_IMPLEMENTED > /** > * do_file_flush - >@@ -107,7 +109,39 @@ do_freeze(int argc, char **argv) > void > print_lockdump(int argc, char **argv) > { >- die("lockdump not implemented\n"); >+ char path[PATH_MAX]; >+ char *name, line[PATH_MAX]; >+ const char *debugfs; >+ FILE *file; >+ int rc = -1, debug_dir_existed = 1; >+ >+ /* See if debugfs is mounted, and if not, mount it. */ >+ debugfs = find_debugfs_mount(); >+ if (!debugfs) { >+ if (access("/debug", F_OK)) { >+ debug_dir_existed = mkdir("/debug", 644); >+ if (debug_dir_existed) >+ die("can't create /debug mount point.\n"); >+ } >+ rc = mount("none", "/debug", "debugfs", 0, NULL); >+ if (rc) >+ die("can't mount debugfs. Maybe your kernel doesn't support it.\n"); >+ debugfs = "/debug"; >+ } >+ name = mp2fsname(argv[optind]); >+ sprintf(path, "%s/gfs2/%s", debugfs, name); >+ file = fopen(path, "rt"); >+ if (!file) >+ die("can't open %s: %s\n", path, strerror(errno)); >+ while (fgets(line, PATH_MAX, file)) { >+ printf(line); >+ } >+ fclose(file); >+ if (!rc) { >+ umount(debugfs); >+ if (!debug_dir_existed) >+ rmdir("/debug"); >+ } > } > > /** >Index: util.c >=================================================================== >RCS file: /cvs/cluster/cluster/gfs2/tool/util.c,v >retrieving revision 1.5 >diff -w -u -p -p -u -r1.5 util.c >--- util.c 15 Jun 2006 16:40:48 -0000 1.5 >+++ util.c 12 Mar 2007 18:46:44 -0000 >@@ -273,6 +273,32 @@ do_basename(char *device) > return basename(device); > } > >+const char * >+find_debugfs_mount(void) >+{ >+ FILE *file; >+ char line[PATH_MAX]; >+ char device[PATH_MAX], type[PATH_MAX]; >+ static char path[PATH_MAX]; >+ >+ file = fopen("/proc/mounts", "rt"); >+ if (!file) >+ die("can't open /proc/mounts: %s\n", strerror(errno)); >+ >+ while (fgets(line, PATH_MAX, file)) { >+ >+ if (sscanf(line, "%s %s %s", device, path, type) != 3) >+ continue; >+ if (!strcmp(type, "debugfs")) { >+ fclose(file); >+ return path; >+ } >+ } >+ >+ fclose(file); >+ return NULL; >+} >+ > char * > mp2devname(char *mp) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228540
:
148091
|
148880
|
149026
| 149854 |
150918
|
150925
|
150936
|
152978