[Cluster-devel] [GFS2/DLM] Pull request
Hi, There have been no changes since I posted the patches for review a few days ago. Please consider pulling the following changes from the GFS2/DLM -nmw git tree: The following changes since commit bbf25010f1a6b761914430f5fca081ec8c7accd1: Linus Torvalds (1): Linux 2.6.23 are found in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw.git Abhijith Das (5): [GFS2] Force unstuff of hidden quota inode [GFS2] Fix quota do_list operation hang [GFS2] Wendy's dump lockname in hex fix glock dump [GFS2] panic after can't parse mount arguments [GFS2] flocks from same process trip kernel BUG at fs/gfs2/glock.c:1118! Benjamin Marzinski (3): [GFS2] Add NULL entry to token table [GFS2] delay glock demote for a minimum hold time [GFS2] Alternate gfs2_iget to avoid looking up inodes being freed Bob Peterson (9): [GFS2] Move some code inside the log lock [GFS2] Revert part of earlier log.c changes [GFS2] Prevent infinite loop in try_rgrp_unlink() [GFS2] Detach buf data during in-place writeback [GFS2] invalid metadata block - REVISED [GFS2] Ensure journal file cache is flushed after recovery [GFS2] Patch to protect sd_log_num_jdata [GFS2] Fix ordering of dirty/journal for ordered buffer unstuffing [GFS2] GFS2: chmod hung - fix race in thread creation David Teigland (1): [DLM] block dlm_recv in recovery transition Denis Cheng (7): [GFS2] use an temp variable to reduce a spin_unlock [GFS2] mark struct *_operations const [GFS2] use the declaration of gfs2_dops in the header file instead [GFS2] use list_for_each_entry instead [GFS2] unneeded typecast [GFS2] better code for translating characters [GFS2] fixed a NULL pointer assignment BUG Jesper Juhl (1): [GFS2] Clean up duplicate includes in fs/gfs2/ Josef Whiter (1): [GFS2] Fix calculation of demote state Patrick Caulfield (3): [DLM] Fix lowcomms socket closing [DLM] Make dlm_sendd cond_resched more [DLM] don't overwrite castparam if it's NULL Steve French (1): [GFS2] GFS2 not checking pointer on create when running under nfsd Steven Whitehouse (16): [GFS2] Fix two races relating to glock callbacks [GFS2] Fix an oops in glock dumping [GFS2] Reduce number of gfs2_scand processes to one [GFS2] Clean up invalidatepage/releasepage [GFS2] Add a missing gfs2_trans_add_bh() [GFS2] Correct lock ordering in unlink [GFS2] Introduce gfs2_remove_from_ail [GFS2] Don't mark jdata dirty in gfs2_unstuffer_page() [GFS2] Move pin/unpin into lops.c, clean up locking [GFS2] Clean up ordered write code [GFS2] Replace revoke structure with bufdata structure [GFS2] Use slab operations for all gfs2_bufdata allocations [GFS2] Clean up gfs2_trans_add_revoke() [GFS2] Clean up journaled data writing [GFS2] Don't try to remove buffers that don't exist [GFS2] Get superblock a different way Wendy Cheng (4): [GFS2] Reduce truncate IO traffic [GFS2] fix inode meta data corruption [GFS2] Move inode deletion out of blocking_cb [GFS2] Data corruption fix fs/dlm/dlm_internal.h |1 + fs/dlm/lock.c | 142 +++- fs/dlm/lock.h |3 +- fs/dlm/lockspace.c |1 + fs/dlm/lowcomms.c | 23 +-- fs/dlm/member.c| 41 +++-- fs/dlm/midcomms.c | 17 +-- fs/dlm/rcom.c | 36 +--- fs/dlm/rcom.h |5 +- fs/dlm/recoverd.c | 11 +- fs/dlm/requestqueue.c | 58 ++--- fs/dlm/requestqueue.h |4 +- fs/gfs2/bmap.c | 35 +++- fs/gfs2/daemon.c | 24 -- fs/gfs2/daemon.h |1 - fs/gfs2/dir.c |3 +- fs/gfs2/eaops.c|8 +- fs/gfs2/eaops.h|4 +- fs/gfs2/glock.c| 293 - fs/gfs2/glock.h|5 +- fs/gfs2/glops.c| 24 +-- fs/gfs2/incore.h | 31 ++-- fs/gfs2/inode.c| 78 ++- fs/gfs2/inode.h|3 +- fs/gfs2/locking/dlm/lock_dlm.h |1 - fs/gfs2/locking/dlm/plock.c| 11 +- fs/gfs2/locking/dlm/thread.c | 20 +- fs/gfs2/locking/nolock/main.c |1 - fs/gfs2/log.c | 230 +--- fs/gfs2/log.h |2 + fs/gfs2/lops.c | 470 fs/gfs2/main.c |3 + fs/gfs2/meta_io.c | 136 +++- fs/gfs2/meta_io.h |6 +- fs/gfs2/mount.c|5 +- fs/gfs2/ops_address.c | 146 - fs/gfs2/ops_export.c |2 +- fs/gfs2/ops_file.c | 13 +-
[Cluster-devel] cluster/cman/man cman_tool.8
CVSROOT:/cvs/cluster Module name:cluster Branch: RHEL4 Changes by: [EMAIL PROTECTED] 2007-10-12 18:16:30 Modified files: cman/man : cman_tool.8 Log message: Update man page to explain 'cman_tool nodes' filter/format options. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/man/cman_tool.8.diff?cvsroot=clusteronly_with_tag=RHEL4r1=1.4.2.5r2=1.4.2.6 --- cluster/cman/man/cman_tool.82007/09/25 20:10:12 1.4.2.5 +++ cluster/cman/man/cman_tool.82007/10/12 18:16:30 1.4.2.6 @@ -130,7 +130,6 @@ Dictates the maximum amount of time cman_tool is prepared to wait. If the operation times out then a status of 2 is returned. -.br .SH JOIN OPTIONS .TP .I -X @@ -219,6 +218,17 @@ Note that just because cman_tool has given up, does not mean that cman itself has stopped trying to join a cluster. +.SH NODES OPTIONS +.TP +.I -n nodename +Shows node information for a specific node. This should be the unqualified node +name as it appears in 'cman_tool nodes'. +.TP +.I -F format +Specify the format of the output. The format string may contain one or +more format options, each seperated by a comma. Valid format options +include: id, name, type, and addr. + .br .SH SERVICES OUTPUT
[Cluster-devel] cluster/cman/cman_tool Makefile cman_tool.h main.c
CVSROOT:/cvs/cluster Module name:cluster Branch: RHEL4 Changes by: [EMAIL PROTECTED] 2007-10-12 18:10:12 Modified files: cman/cman_tool : Makefile cman_tool.h main.c Log message: Add ability to format output and filter based on node name. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/Makefile.diff?cvsroot=clusteronly_with_tag=RHEL4r1=1.4.2.1r2=1.4.2.2 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/cman_tool.h.diff?cvsroot=clusteronly_with_tag=RHEL4r1=1.3.2.5r2=1.3.2.6 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/main.c.diff?cvsroot=clusteronly_with_tag=RHEL4r1=1.12.2.9r2=1.12.2.10 --- cluster/cman/cman_tool/Makefile 2005/03/08 16:42:49 1.4.2.1 +++ cluster/cman/cman_tool/Makefile 2007/10/12 18:10:12 1.4.2.2 @@ -37,7 +37,7 @@ cp ${TARGET} ${top_srcdir}/bin cman_tool: main.o join.o join_ccs.o - $(CC) $(LDFLAGS) -L$(libdir) -o $@ $^ -lccs + $(CC) $(LDFLAGS) -L$(libdir) -o $@ $^ -lccs -lcman main.o: main.c cman_tool.h $(CC) $(CFLAGS) -c -o $@ $ --- cluster/cman/cman_tool/cman_tool.h 2006/12/18 13:37:55 1.3.2.5 +++ cluster/cman/cman_tool/cman_tool.h 2007/10/12 18:10:12 1.3.2.6 @@ -35,7 +35,6 @@ #include limits.h #include unistd.h - extern char *prog_name; #ifndef TRUE @@ -50,14 +49,22 @@ exit(EXIT_FAILURE); \ } while (0) - #define DEFAULT_PORT 6809 #define DEFAULT_VOTES 1 #define MAX_INTERFACES 10 +#define MAX_FORMAT_OPTS 10 #define MAX_NODE_NAME_LEN 65 #define MAX_MCAST_NAME_LEN 256 #define MAX_PATH_LEN 256 +enum format_opt +{ + FMT_NONE, + FMT_ID, + FMT_NAME, + FMT_TYPE, + FMT_ADDR, +}; struct commandline { @@ -68,6 +75,7 @@ char *multicast_names[MAX_INTERFACES]; char *nodenames[MAX_INTERFACES]; char *interfaces[MAX_INTERFACES]; + char *format_opts; int votes; int expected_votes; int two_node; --- cluster/cman/cman_tool/main.c 2006/07/10 13:15:56 1.12.2.9 +++ cluster/cman/cman_tool/main.c 2007/10/12 18:10:12 1.12.2.10 @@ -14,11 +14,14 @@ #include inttypes.h #include unistd.h #include signal.h +#include time.h +#include netinet/in.h #include copyright.cf #include cnxman-socket.h +#include libcman.h #include cman_tool.h -#define OPTION_STRING (m:n:v:e:2p:c:r:i:N:t:XVwqh?d) +#define OPTION_STRING (m:n:v:e:2p:c:r:i:N:t:XF:Vwqh?d) #define OP_JOIN1 #define OP_LEAVE 2 #define OP_EXPECTED3 @@ -88,6 +91,8 @@ printf(status Show local record of cluster status\n); printf(\n); printf(nodes Show local record of cluster nodes\n); + printf( -n nodenameOnly show information for specific node\n); + printf( -F format Specify output format (see man page)\n); printf(\n); printf(services Show local record of cluster services\n); @@ -133,6 +138,128 @@ show_file(/proc/cluster/services); } +static int node_filter(commandline_t *comline, const char *node) +{ + int i; + + for (i = 0; i comline-num_nodenames; i++) { + if (strcmp(comline-nodenames[i], node) == 0) { + return TRUE; + } + } + + return FALSE; +} + +static int get_format_opt(const char *opt) +{ + if (!opt) + return FMT_NONE; + + if (!strcmp(opt, id)) + return FMT_ID; + if (!strcmp(opt, name)) + return FMT_NAME; + if (!strcmp(opt, type)) + return FMT_TYPE; + if (!strcmp(opt, addr)) + return FMT_ADDR; + + return FMT_NONE; +} + +static void show_nodes_opt(commandline_t *comline) +{ + cman_handle_t h; + int count; + int i; + int j; + int numnodes; + int format[MAX_FORMAT_OPTS]; + cman_node_t *nodes; + + h = cman_init(NULL); + + count = cman_get_node_count(h); + if (count 0) + die(cman_get_node_count failed: %s, cman_error(errno)); + + count += 2; + + nodes = malloc(sizeof(cman_node_t) * count); + if (!nodes) + die(cannot allocate memory for nodes list\n); + + if (comline-format_opts != NULL) { + char *format_str = comline-format_opts; + char *format_tmp; + for (i = 0; i MAX_FORMAT_OPTS; i++) { + format_tmp = strtok(format_str, ,); + format_str = NULL; + format[i] = get_format_opt(format_tmp); + } + } + + if (cman_get_nodes(h, count, numnodes, nodes) 0) + die(cman_get_nodes failed: %s, cman_error(errno)); + + if (!comline-format_opts) { + printf(Node Sts Inc Name\n); + } + + for (i = 0; i numnodes; i++) { +
[Cluster-devel] cluster/cman/cman_tool cman_tool.h main.c
CVSROOT:/cvs/cluster Module name:cluster Branch: RHEL5 Changes by: [EMAIL PROTECTED] 2007-10-12 18:50:48 Modified files: cman/cman_tool : cman_tool.h main.c Log message: Add ability to format output and filter based on node name. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/cman_tool.h.diff?cvsroot=clusteronly_with_tag=RHEL5r1=1.12r2=1.12.2.1 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/main.c.diff?cvsroot=clusteronly_with_tag=RHEL5r1=1.51.2.4r2=1.51.2.5 --- cluster/cman/cman_tool/cman_tool.h 2006/05/10 14:20:06 1.12 +++ cluster/cman/cman_tool/cman_tool.h 2007/10/12 18:50:48 1.12.2.1 @@ -35,7 +35,6 @@ #include limits.h #include unistd.h - extern char *prog_name; #ifndef TRUE @@ -50,13 +49,21 @@ exit(EXIT_FAILURE); \ } while (0) - #define DEFAULT_VOTES 1 #define MAX_INTERFACES 10 +#define MAX_FORMAT_OPTS 10 #define MAX_NODE_NAME_LEN 65 #define MAX_MCAST_NAME_LEN 256 #define MAX_PATH_LEN 256 +enum format_opt +{ + FMT_NONE, + FMT_ID, + FMT_NAME, + FMT_TYPE, + FMT_ADDR, +}; struct commandline { @@ -67,6 +74,7 @@ char *interfaces[MAX_INTERFACES]; char *override_nodename; char *key_filename; + char *format_opts; int votes; int expected_votes; int two_node; --- cluster/cman/cman_tool/main.c 2007/09/28 13:26:14 1.51.2.4 +++ cluster/cman/cman_tool/main.c 2007/10/12 18:50:48 1.51.2.5 @@ -20,7 +20,7 @@ #include libcman.h #include cman_tool.h -#define OPTION_STRING (m:n:v:e:2p:c:r:i:N:t:o:k:Vwfqah?d::) +#define OPTION_STRING (m:n:v:e:2p:c:r:i:N:t:o:k:F:Vwfqah?d::) #define OP_JOIN1 #define OP_LEAVE 2 #define OP_EXPECTED3 @@ -110,6 +110,8 @@ printf(nodes Show local record of cluster nodes\n); printf( -f Also show when node was last fenced\n); printf( -a Also show node address(es)\n); + printf( -n nodename Only show information for specific node\n); + printf( -F formatSpecify output format (see man page)\n); printf(\n); } @@ -300,13 +302,46 @@ return a-cn_nodeid - b-cn_nodeid; } +static int node_filter(commandline_t *comline, const char *node) +{ + int i; + + for (i = 0; i comline-num_nodenames; i++) { + if (strcmp(comline-nodenames[i], node) == 0) { + return TRUE; + } + } + + return FALSE; +} + +static int get_format_opt(const char *opt) +{ + if (!opt) + return FMT_NONE; + + if (!strcmp(opt, id)) + return FMT_ID; + if (!strcmp(opt, name)) + return FMT_NAME; + if (!strcmp(opt, type)) + return FMT_TYPE; + if (!strcmp(opt, addr)) + return FMT_ADDR; + + return FMT_NONE; +} + static void show_nodes(commandline_t *comline) { cman_handle_t h; int count; int i; + int j; + int k; int numnodes; int dis_count; + int format[MAX_FORMAT_OPTS]; cman_node_t *dis_nodes; cman_node_t *nodes; struct tm *jtime; @@ -325,6 +360,16 @@ if (!nodes) die(cannot allocate memory for nodes list\n); + if (comline-format_opts != NULL) { + char *format_str = comline-format_opts; + char *format_tmp; + for (i = 0; i MAX_FORMAT_OPTS; i++) { + format_tmp = strtok(format_str, ,); + format_str = NULL; + format[i] = get_format_opt(format_tmp); + } + } + if (cman_get_nodes(h, count, numnodes, nodes) 0) die(cman_get_nodes failed: %s, cman_error(errno)); @@ -333,9 +378,8 @@ dis_nodes = malloc(sizeof(cman_node_t) * count); if (cman_get_disallowed_nodes(h, count, dis_count, dis_nodes) == 0) { - int i,j; - for (i=0; inumnodes; i++) { - for (j=0; jdis_count; j++) { + for (i = 0; i numnodes; i++) { + for (j = 0; j dis_count; j++) { if (dis_nodes[j].cn_nodeid == nodes[i].cn_nodeid) nodes[i].cn_member = 2; } @@ -350,10 +394,19 @@ printf( members list may seem inconsistent across the cluster\n); } - printf(Node Sts Inc Joined Name\n); - for (i=0; inumnodes; i++) { + if (!comline-format_opts) { + printf(Node Sts Inc Joined Name\n); + } + + for (i = 0; i numnodes; i++) { char member_type; + if
[Cluster-devel] cluster/cman/man cman_tool.8
CVSROOT:/cvs/cluster Module name:cluster Branch: RHEL5 Changes by: [EMAIL PROTECTED] 2007-10-12 18:53:57 Modified files: cman/man : cman_tool.8 Log message: Update man page to explain 'cman_tool nodes' filter/format options. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/man/cman_tool.8.diff?cvsroot=clusteronly_with_tag=RHEL5r1=1.9.2.3r2=1.9.2.4 --- cluster/cman/man/cman_tool.82007/09/17 13:59:31 1.9.2.3 +++ cluster/cman/man/cman_tool.82007/10/12 18:53:57 1.9.2.4 @@ -242,7 +242,18 @@ .TP .I -a Shows the IP address(es) the nodes are communicating on. - +.br +.TP +.I -n nodename +Shows node information for a specific node. This should be the unqualified node +name as it appears in 'cman_tool nodes'. +.br +.TP +.I -F format +Specify the format of the output. The format string may contain one or +more format options, each seperated by a comma. Valid format options +include: id, name, type, and addr. +.br .SH DEBUG OPTIONS .TP .I -d value
[Cluster-devel] cluster/gfs2 edit/hexedit.c man/gfs2_edit.8
CVSROOT:/cvs/cluster Module name:cluster Changes by: [EMAIL PROTECTED] 2007-10-12 21:38:18 Modified files: gfs2/edit : hexedit.c gfs2/man : gfs2_edit.8 Log message: Resolves: 235931: gfs2_edit command to set NOALLOC flag Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/edit/hexedit.c.diff?cvsroot=clusterr1=1.20r2=1.21 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/man/gfs2_edit.8.diff?cvsroot=clusterr1=1.2r2=1.3 --- cluster/gfs2/edit/hexedit.c 2007/10/12 15:37:19 1.20 +++ cluster/gfs2/edit/hexedit.c 2007/10/12 21:38:18 1.21 @@ -602,6 +602,98 @@ } /* */ +/* rgcount - return how many rgrps there are. */ +/* */ +void rgcount(void) +{ + uint64_t block; + struct gfs2_buffer_head *ribh; + struct gfs2_inode *riinode; + + if (gfs1) + block = sbd1-sb_rindex_di.no_addr; + else + block = masterblock(rindex); + ribh = bread(sbd, block); + riinode = inode_get(sbd, ribh); + printf(%d RGs in this file system.\n, + riinode-i_di.di_size / sizeof(struct gfs2_rindex)); + inode_put(riinode, not_updated); + exit(EXIT_SUCCESS); +} + +/* */ +/* find_rgrp_block - locate the block for a given rgrp number */ +/* */ +uint64_t find_rgrp_block(struct gfs2_inode *di, int rg) +{ + char buf[sizeof(struct gfs2_rindex)]; + int amt; + struct gfs2_rindex ri; + + amt = gfs2_readi(di, (void *)buf, +rg * sizeof(struct gfs2_rindex), +sizeof(struct gfs2_rindex)); + if (!amt) /* end of file */ + return 0; + gfs2_rindex_in(ri, buf); + return ri.ri_addr; +} + +/* */ +/* set_rgrp_flags - Set an rgrp's flags to a given value*/ +/* rgnum: which rg to print or modify flags for (0 - X) */ +/* new_flags: value to set new rg_flags to (if modify == TRUE) */ +/* modify: TRUE if the value is to be modified, FALSE if it's to be printed */ +/* full: TRUE if the full RG should be printed. */ +/* */ +void set_rgrp_flags(int rgnum, uint32_t new_flags, int modify, int full) +{ + struct gfs2_rgrp rg; + struct gfs2_buffer_head *bh, *ribh; + uint64_t rgblk, block; + struct gfs2_inode *riinode; + + if (gfs1) + block = sbd1-sb_rindex_di.no_addr; + else + block = masterblock(rindex); + ribh = bread(sbd, block); + riinode = inode_get(sbd, ribh); + if (rgnum = riinode-i_di.di_size / sizeof(struct gfs2_rindex)) { + fprintf(stderr, Error: File system only has %d RGs.\n, + riinode-i_di.di_size / sizeof(struct gfs2_rindex)); + inode_put(riinode, not_updated); + brelse(ribh, not_updated); + return; + } + rgblk = find_rgrp_block(riinode, rgnum); + bh = bread(sbd, rgblk); + gfs2_rgrp_in(rg, bh-b_data); + if (modify) { + printf(RG #%d (block %lld / 0x%llx) rg_flags changed from 0x%08x to 0x%08x\n, + rgnum, rgblk, rgblk, rg.rg_flags, new_flags); + rg.rg_flags = new_flags; + gfs2_rgrp_out(rg, bh-b_data); + brelse(bh, updated); + } else { + if (full) { + print_gfs2(RG #%d, rgnum); + print_gfs2( located at: %llu (0x%llx), rgblk, rgblk); +eol(0); + gfs2_rgrp_print(rg); + } + else + printf(RG #%d (block %lld / 0x%llx) rg_flags = 0x%08x\n, + rgnum, rgblk, rgblk, rg.rg_flags); + brelse(bh, not_updated); + } + inode_put(riinode, not_updated); + if (modify) + bsync(sbd); +} + +/* */ /* parse_rindex - print the rgindex file. */ /* */ int parse_rindex(struct gfs2_inode *di, int print_rindex) @@ -622,9 +714,9 @@ error = gfs2_readi(di, (void *)buf, print_entry_ndx * sizeof(struct gfs2_rindex), sizeof(struct gfs2_rindex)); - gfs2_rindex_in(ri, buf); if (!error)