commit 2c727af4b254f489313836569e0a445f32eea677 Author: CentOS Sources Date: Tue Jan 21 18:29:37 2020 -0500 import gfs2-utils-3.2.0-7.el8 diff --git a/.gfs2-utils.metadata b/.gfs2-utils.metadata new file mode 100644 index 0000000..7b4733e --- /dev/null +++ b/.gfs2-utils.metadata @@ -0,0 +1 @@ +d08266389e4752fb53bd3297810296276ff395e5 SOURCES/gfs2-utils-3.2.0.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ab8d158 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/gfs2-utils-3.2.0.tar.gz diff --git a/SOURCES/bz1622050-1-fsck_gfs2_Don_t_check_fs_formats_we_don_t_recognise.patch b/SOURCES/bz1622050-1-fsck_gfs2_Don_t_check_fs_formats_we_don_t_recognise.patch new file mode 100644 index 0000000..df25fc1 --- /dev/null +++ b/SOURCES/bz1622050-1-fsck_gfs2_Don_t_check_fs_formats_we_don_t_recognise.patch @@ -0,0 +1,130 @@ +commit 47261faa39aca05d6feb486fdeec26f8ffc3ef15 +Author: Andrew Price +Date: Fri Aug 17 12:49:24 2018 +0100 + + fsck.gfs2: Don't check fs formats we don't recognise + + Currently fsck.gfs2 will ignore sb_fs_format but in order to support + future formats we need to make sure it doesn't try to check filesystems + with formats we don't recognise yet. Better late than never. + + Tests included. + + rhbz#1616389 + rhbz#1622050 + + Signed-off-by: Andrew Price + +diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h +index d3f76352..877448c3 100644 +--- a/gfs2/fsck/fsck.h ++++ b/gfs2/fsck/fsck.h +@@ -4,6 +4,8 @@ + #include "libgfs2.h" + #include "osi_tree.h" + ++#define FSCK_MAX_FORMAT (1801) ++ + #define FSCK_HASH_SHIFT (13) + #define FSCK_HASH_SIZE (1 << FSCK_HASH_SHIFT) + #define FSCK_HASH_MASK (FSCK_HASH_SIZE - 1) +diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c +index ebe62b9f..d1c620af 100644 +--- a/gfs2/fsck/initialize.c ++++ b/gfs2/fsck/initialize.c +@@ -1334,12 +1334,12 @@ static int fill_super_block(struct gfs2_sbd *sdp) + if (sizeof(struct gfs2_sb) > sdp->sd_sb.sb_bsize){ + log_crit( _("GFS superblock is larger than the blocksize!\n")); + log_debug("sizeof(struct gfs2_sb) > sdp->sd_sb.sb_bsize\n"); +- return -1; ++ return FSCK_ERROR; + } + + if (compute_constants(sdp)) { + log_crit("%s\n", _("Failed to compute file system constants")); +- exit(FSCK_ERROR); ++ return FSCK_ERROR; + } + ret = read_sb(sdp); + if (ret < 0) { +@@ -1348,10 +1348,15 @@ static int fill_super_block(struct gfs2_sbd *sdp) + /* Now that we've tried to repair it, re-read it. */ + ret = read_sb(sdp); + if (ret < 0) +- return -1; ++ return FSCK_ERROR; + } + if (sdp->gfs1) + sbd1 = (struct gfs_sb *)&sdp->sd_sb; ++ else if (sdp->sd_sb.sb_fs_format > FSCK_MAX_FORMAT) { ++ log_crit(_("Unsupported gfs2 format found: %"PRIu32"\n"), sdp->sd_sb.sb_fs_format); ++ log_crit(_("A newer fsck.gfs2 is required to check this file system.\n")); ++ return FSCK_USAGE; ++ } + return 0; + } + +@@ -1556,6 +1561,7 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen, + int *all_clean) + { + int clean_journals = 0, open_flag; ++ int err; + + *all_clean = 0; + +@@ -1601,8 +1607,9 @@ int initialize(struct gfs2_sbd *sdp, int force_check, int preen, + } + + /* read in sb from disk */ +- if (fill_super_block(sdp)) +- return FSCK_ERROR; ++ err = fill_super_block(sdp); ++ if (err != FSCK_OK) ++ return err; + + /* Change lock protocol to be fsck_* instead of lock_* */ + if (!opts.no && preen_is_safe(sdp, preen, force_check)) { +diff --git a/gfs2/libgfs2/super.c b/gfs2/libgfs2/super.c +index 6e7d8c23..75925643 100644 +--- a/gfs2/libgfs2/super.c ++++ b/gfs2/libgfs2/super.c +@@ -29,11 +29,18 @@ int check_sb(struct gfs2_sb *sb) + errno = EIO; + return -1; + } ++ /* Check for gfs1 */ + if (sb->sb_fs_format == GFS_FORMAT_FS && + sb->sb_header.mh_format == GFS_FORMAT_SB && + sb->sb_multihost_format == GFS_FORMAT_MULTI) { + return 1; + } ++ /* It's gfs2. Check format number is in a sensible range. */ ++ if (sb->sb_fs_format < GFS2_FORMAT_FS || ++ sb->sb_fs_format > 1899) { ++ errno = EINVAL; ++ return -1; ++ } + return 2; + } + +diff --git a/tests/fsck.at b/tests/fsck.at +index 39a04d04..97a00a90 100644 +--- a/tests/fsck.at ++++ b/tests/fsck.at +@@ -54,3 +54,16 @@ AT_CHECK([gfs2_edit -p journal0 field di_header.mh_magic 0 $GFS_TGT], 0, [ignore + AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore]) + AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore]) + AT_CLEANUP ++ ++AT_SETUP([gfs2 format versions]) ++AT_KEYWORDS(fsck.gfs2 fsck) ++GFS_TGT_REGEN ++AT_CHECK([mkfs.gfs2 -O -p lock_nolock ${GFS_TGT}], 0, [ignore], [ignore]) ++AT_CHECK([echo "set sb { sb_fs_format: 1802 }" | gfs2l ${GFS_TGT}], 0, [ignore], [ignore]) ++# Unsupported format, FSCK_USAGE == 16 ++AT_CHECK([fsck.gfs2 -y $GFS_TGT], 16, [ignore], [ignore]) ++# Format out of range ++AT_CHECK([echo "set sb { sb_fs_format: 4242 }" | gfs2l ${GFS_TGT}], 0, [ignore], [ignore]) ++AT_CHECK([fsck.gfs2 -y $GFS_TGT], 1, [ignore], [ignore]) ++AT_CHECK([fsck.gfs2 -n $GFS_TGT], 0, [ignore], [ignore]) ++AT_CLEANUP diff --git a/SOURCES/bz1622050-2-libgfs2_Fix_pointer_cast_byte_order_issue.patch b/SOURCES/bz1622050-2-libgfs2_Fix_pointer_cast_byte_order_issue.patch new file mode 100644 index 0000000..d86d871 --- /dev/null +++ b/SOURCES/bz1622050-2-libgfs2_Fix_pointer_cast_byte_order_issue.patch @@ -0,0 +1,47 @@ +commit 57553571df2f33ec45a81fa5599873ddfc890c92 +Author: Andrew Price +Date: Thu Sep 6 14:28:19 2018 +0100 + + libgfs2: Fix pointer cast byte order issue + + lgfs2_field_assign() currently uses pointer casting to achieve generic + integer assignment based on the width of the field, but this is broken + as a uin32_t field can be assigned the value from the high bytes of the + uint64_t value, for instance. To fix this, store the value into a + uint64_t before casting to the narrower types. + + Signed-off-by: Andrew Price + +diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c +index a8289466..e0ea4912 100644 +--- a/gfs2/libgfs2/meta.c ++++ b/gfs2/libgfs2/meta.c +@@ -940,6 +940,7 @@ int lgfs2_field_str(char *str, const size_t size, const char *blk, const struct + int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const void *val) + { + char *fieldp = blk + field->offset; ++ uint64_t num = *(uint64_t *)val; + + if (field->flags & LGFS2_MFF_UUID) { + memcpy(fieldp, val, 16); +@@ -959,16 +960,16 @@ int lgfs2_field_assign(char *blk, const struct lgfs2_metafield *field, const voi + + switch(field->length) { + case sizeof(uint8_t): +- *fieldp = *(uint8_t *)val; ++ *fieldp = (uint8_t)num; + return 0; + case sizeof(uint16_t): +- *(uint16_t *)fieldp = cpu_to_be16(*(uint16_t *)val); ++ *(uint16_t *)fieldp = cpu_to_be16((uint16_t)num); + return 0; + case sizeof(uint32_t): +- *(uint32_t *)fieldp = cpu_to_be32(*(uint32_t *)val); ++ *(uint32_t *)fieldp = cpu_to_be32((uint32_t)num); + return 0; + case sizeof(uint64_t): +- *(uint64_t *)fieldp = cpu_to_be64(*(uint64_t *)val); ++ *(uint64_t *)fieldp = cpu_to_be64((uint64_t)num); + return 0; + default: + /* Will never happen */ diff --git a/SOURCES/bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals.patch b/SOURCES/bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals.patch new file mode 100644 index 0000000..9745c8d --- /dev/null +++ b/SOURCES/bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals.patch @@ -0,0 +1,39 @@ +commit 7095c5f1ab7ab2d9e02c203c9966b65c09249e1f +Author: Bob Peterson +Date: Fri Dec 14 09:16:19 2018 -0500 + + gfs2-utils: Wrong hash value used to clean journals + + When fsck.gfs2 sees a dirty journal, (one that does not have a + log header with the UNMOUNT flag set at the wrap-point), it replays + the journal and writes a log header out to "clean" the journal. + Unfortunately, before this patch, it was using the wrong hash value. + So every time fsck.gfs2 was run, it would not recognize its own + log header because of the wrong hash, and therefore it would always + see the journal as dirty with every run (until the file system is + mounted and unmounted, which would write a new correct log header). + Therefore, multiple runs of fsck.gfs2 would always result in a + replay of the journal, which remains "dirty." + + This patch changes function clean_journal so that it uses the + correct hash function. Therefore, the journal will be truly clean + and consecutive runs (or mounts) will find the journal clean. + + Resolves: rhbz#1659490 + + Signed-off-by: Bob Peterson + Signed-off-by: Andrew Price + +diff --git a/gfs2/libgfs2/recovery.c b/gfs2/libgfs2/recovery.c +index 6b14bf94..06f81116 100644 +--- a/gfs2/libgfs2/recovery.c ++++ b/gfs2/libgfs2/recovery.c +@@ -241,7 +241,7 @@ int clean_journal(struct gfs2_inode *ip, struct gfs2_log_header *head) + lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1); + lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT); + lh->lh_blkno = cpu_to_be32(lblock); +- hash = gfs2_disk_hash((const char *)lh, sizeof(struct gfs2_log_header)); ++ hash = lgfs2_log_header_hash(bh->b_data); + lh->lh_hash = cpu_to_be32(hash); + bmodified(bh); + brelse(bh); diff --git a/SOURCES/bz1693000-fsck_gfs2_8_Manpage_updates.patch b/SOURCES/bz1693000-fsck_gfs2_8_Manpage_updates.patch new file mode 100644 index 0000000..f4a0a66 --- /dev/null +++ b/SOURCES/bz1693000-fsck_gfs2_8_Manpage_updates.patch @@ -0,0 +1,86 @@ +commit f81fd07bdf8cf9f87c603754e3e5b89ed5445bf8 +Author: Andrew Price +Date: Thu Oct 17 13:12:31 2019 +0100 + + fsck.gfs2(8): Manpage updates + + - Improve style consistency with the other manpages + - Remove an unnecessary paragraph that gives a misleading impression of + gfs2's device atomicity requirements (rhbz#1693000) + - Add "See Also" section + - "fsck.gfs" -> "fsck.gfs2" + - Various other language tweaks + + Signed-off-by: Andrew Price + +diff --git a/gfs2/man/fsck.gfs2.8 b/gfs2/man/fsck.gfs2.8 +index b2b326fb..9e9f9250 100644 +--- a/gfs2/man/fsck.gfs2.8 ++++ b/gfs2/man/fsck.gfs2.8 +@@ -1,11 +1,11 @@ + .TH fsck.gfs2 8 + + .SH NAME +-fsck.gfs2 - Offline GFS and GFS2 file system checker ++fsck.gfs2 - offline GFS and GFS2 file system checker + + .SH SYNOPSIS + .B fsck.gfs2 +-[\fIOPTION\fR]... \fIDEVICE\fR ++[\fIoptions\fR] \fIdevice\fR + + .SH WARNING + All computers \fImust\fP have the filesystem unmounted before running +@@ -13,30 +13,22 @@ fsck.gfs2. Failure to unmount from all nodes in a cluster will likely result + in filesystem corruption. + + .SH DESCRIPTION +-fsck.gfs2 will check that the GFS or GFS2 file system on a device is structurally valid. +-It should not be run on a mounted file system. If file system corruption is +-detected, it will attempt to repair the file system. There is a limit to what +-fsck.gfs2 can do. If important file system structures are destroyed, such that +-the checker cannot determine what the repairs should be, reparations could +-fail. ++fsck.gfs2 will check that the GFS or GFS2 file system on a device is ++structurally valid. It should not be run on a mounted file system. If file ++system corruption is detected, it will attempt to repair the file system. ++There is a limit to what fsck.gfs2 can do. If important file system structures ++are destroyed, such that the checker cannot determine what the repairs should ++be, reparations could fail. + +-GFS2 is a journaled file system, and as such should be able to repair damage to +-the file system on its own. However, faulty hardware has the ability to write +-incomplete blocks to a file system thereby causing corruption that GFS2 cannot +-fix. The first step to ensuring a healthy file system is the selection of +-reliable hardware (i.e. storage systems that will write complete blocks - even +-in the event of power failure). +- +-Note: Most file system checkers will not check the file system if it is +-"clean" (i.e. unmounted since the last use). The fsck.gfs program behaves +-differently because the storage may be shared among several nodes in a +-cluster, and therefore problems may have been introduced on a different +-computer. Therefore, fsck.gfs2 will always check the file system unless +-the -p (preen) option is used, in which case it follows special rules ++Other file system checkers will not check the file system if it is "clean" ++(i.e. unmounted since the last use). With gfs2, storage may be shared among ++several nodes in a cluster, and therefore problems may have been introduced on ++a different computer. Therefore, fsck.gfs2 will always check the file system ++unless the -p (preen) option is used, in which case it follows special rules + (see below). + +-fsck.gfs2 will log to the system log on start and exit to aid debugging and +-administration. ++fsck.gfs2 will log a message to the system log on start and exit to aid ++debugging and administration. + .SH OPTIONS + .TP + \fB-a\fP +@@ -86,3 +78,8 @@ Yes to all questions. By specifying this option, fsck.gfs2 will not prompt befor + changes. + + This option may not be used with the \fB-n\fP or \fB-p\fP/\fB-a\fP options. ++ ++.SH SEE ALSO ++.BR gfs2 (5), ++.BR gfs2_jadd (8), ++.BR gfs2_grow (8) diff --git a/SOURCES/bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group.patch b/SOURCES/bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group.patch new file mode 100644 index 0000000..3669d4d --- /dev/null +++ b/SOURCES/bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group.patch @@ -0,0 +1,47 @@ +commit 12a82c8661b003736a0cb14fe042605f2412c329 +Author: Andrew Price +Date: Thu Apr 25 11:21:22 2019 +0100 + + mkfs.gfs2: Improve alignment of first resource group + + Currently the first rgrp is aligned to the whole stripe width and the + second rgrp is aligned to (stripe width + 1 stripe unit) and so on, to + spread them across an array. However, that means that there could be a + large amount of space wasted between the superblock and the first + resource group, and can result in the iovec used to zero that space + exceeding IOV_MAX and failing mkfs.gfs2 (since 6cefaf33d5) if the array + has a sufficiently large number of LUNs. Instead, align the first + resource group to a stripe unit so that the gap is minimised. Resource + groups are still spread across the array as the alignment of subsequent + ones are handled separately. + + Resolves: rhbz#1698858 + + Signed-off-by: Andrew Price + +diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c +index 3cdaccae..20ce5807 100644 +--- a/gfs2/libgfs2/rgrp.c ++++ b/gfs2/libgfs2/rgrp.c +@@ -332,7 +332,7 @@ static uint64_t align_block(const uint64_t base, const uint64_t align) + */ + uint64_t lgfs2_rgrp_align_addr(const lgfs2_rgrps_t rgs, uint64_t addr) + { +- return align_block(addr, rgs->align); ++ return align_block(addr, rgs->align_off); + } + + /** +diff --git a/tests/mkfs.at b/tests/mkfs.at +index 2739561f..57785a0d 100644 +--- a/tests/mkfs.at ++++ b/tests/mkfs.at +@@ -122,6 +122,8 @@ AT_KEYWORDS(mkfs.gfs2 mkfs) + AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:512:65536:393216:512 $GFS_TGT], 0, [ignore], [ignore]) + # Check rgrp alignment to minimum_io_size: 65536 / 4096 == 16 + AT_CHECK([gfs2_edit -p rindex $GFS_TGT | grep ri_addr | awk '{print $2, $2 % 16; if ($2 % 16 != 0) { exit 1 }}'], 0, [ignore], [ignore]) ++# rhbz#1698858 ++AT_CHECK([$GFS_MKFS -p lock_nolock -o test_topology=0:512:131072:6291456:512 $GFS_TGT], 0, [ignore], [ignore]) + AT_CLEANUP + + AT_SETUP([Values of rg_skip]) diff --git a/SOURCES/bz1757115-gfs2_5_General_updates_and_layout_improvements.patch b/SOURCES/bz1757115-gfs2_5_General_updates_and_layout_improvements.patch new file mode 100644 index 0000000..46b6b6d --- /dev/null +++ b/SOURCES/bz1757115-gfs2_5_General_updates_and_layout_improvements.patch @@ -0,0 +1,291 @@ +commit 75934649b85259d1559eabca40be820095643239 +Author: Andrew Price +Date: Tue Feb 12 09:58:11 2019 +0000 + + gfs2.5: General updates and layout improvements + + - Update the manpage to mention lvmlockd and don't mention gfs2_quota + or gfs_controld (both obsolete). + - Simplify the setup instructions and refer to distribution-specific + docs and support requirements. + - Rearrange the "See also" section for relevance and incorporate the + references from the setup section. + + Signed-off-by: Andrew Price + +diff --git a/gfs2/man/gfs2.5 b/gfs2/man/gfs2.5 +index 56d1a008..436abc09 100644 +--- a/gfs2/man/gfs2.5 ++++ b/gfs2/man/gfs2.5 +@@ -21,6 +21,20 @@ mounts which are equivalent to mounting a read-only block device and as + such can neither recover a journal or write to the filesystem, so do not + require a journal assigned to them. + ++The GFS2 documentation has been split into a number of sections: ++ ++\fBmkfs.gfs2\fP(8) Create a GFS2 filesystem ++.br ++\fBfsck.gfs2\fP(8) The GFS2 filesystem checker ++.br ++\fBgfs2_grow\fP(8) Growing a GFS2 filesystem ++.br ++\fBgfs2_jadd\fP(8) Adding a journal to a GFS2 filesystem ++.br ++\fBtunegfs2\fP(8) Tool to manipulate GFS2 superblocks ++.br ++\fBgfs2_edit\fP(8) A GFS2 debug tool (use with caution) ++ + .SH MOUNT OPTIONS + + .TP +@@ -200,220 +214,55 @@ versa. Finally, when first enabling this option on a filesystem that had been + previously mounted without it, you must make sure that there are no outstanding + cookies being cached by other software, such as NFS. + +-.SH BUGS +- +-GFS2 doesn't support \fBerrors=\fP\fIremount-ro\fR or \fBdata=\fP\fIjournal\fR. +-It is not possible to switch support for user and group quotas on and +-off independently of each other. Some of the error messages are rather +-cryptic, if you encounter one of these messages check firstly that gfs_controld +-is running and secondly that you have enough journals on the filesystem +-for the number of nodes in use. +- +-.SH SEE ALSO +- +-\fBmount\fP(8) for general mount options, +-\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags, +-\fBacl\fP(5) for access control lists, +-\fBlvm\fP(8) for volume management, +-\fBccs\fP(7) for cluster management, +-\fBumount\fP(8), +-\fBinitrd\fP(4). +- +-The GFS2 documentation has been split into a number of sections: +- +-\fBgfs2_edit\fP(8) A GFS2 debug tool (use with caution) +-\fBfsck.gfs2\fP(8) The GFS2 file system checker +-\fBgfs2_grow\fP(8) Growing a GFS2 file system +-\fBgfs2_jadd\fP(8) Adding a journal to a GFS2 file system +-\fBmkfs.gfs2\fP(8) Make a GFS2 file system +-\fBgfs2_quota\fP(8) Manipulate GFS2 disk quotas +-\fBgfs2_tool\fP(8) Tool to manipulate a GFS2 file system (obsolete) +-\fBtunegfs2\fP(8) Tool to manipulate GFS2 superblocks +- + .SH SETUP + +-GFS2 clustering is driven by the dlm, which depends on dlm_controld to +-provide clustering from userspace. dlm_controld clustering is built on +-corosync cluster/group membership and messaging. +- +-Follow these steps to manually configure and run gfs2/dlm/corosync. +- +-.B 1. create /etc/corosync/corosync.conf and copy to all nodes +- +-In this sample, replace cluster_name and IP addresses, and add nodes as +-needed. If using only two nodes, uncomment the two_node line. +-See corosync.conf(5) for more information. +- +-.nf +-totem { +- version: 2 +- secauth: off +- cluster_name: abc +-} +- +-nodelist { +- node { +- ring0_addr: 10.10.10.1 +- nodeid: 1 +- } +- node { +- ring0_addr: 10.10.10.2 +- nodeid: 2 +- } +- node { +- ring0_addr: 10.10.10.3 +- nodeid: 3 +- } +-} +- +-quorum { +- provider: corosync_votequorum +-# two_node: 1 +-} +- +-logging { +- to_syslog: yes +-} +-.fi +- +-.PP +- +-.B 2. start corosync on all nodes +- +-.nf +-systemctl start corosync +-.fi +- +-Run corosync-quorumtool to verify that all nodes are listed. +- +-.PP +- +-.B 3. create /etc/dlm/dlm.conf and copy to all nodes +- +-.B * +-To use no fencing, use this line: ++GFS2 clustering is driven by the dlm, which depends on dlm_controld to provide ++clustering from userspace. dlm_controld clustering is built on corosync ++cluster/group membership and messaging. GFS2 also requires clustered lvm which ++is provided by lvmlockd or, previously, clvmd. Refer to the documentation for ++each of these components and ensure that they are configured before setting up ++a GFS2 filesystem. Also refer to your distribution's documentation for any ++specific support requirements. + +-.nf +-enable_fencing=0 +-.fi ++Ensure that gfs2-utils is installed on all nodes which mount the filesystem as ++it provides scripts required for correct withdraw event response. + +-.B * +-To use no fencing, but exercise fencing functions, use this line: +- +-.nf +-fence_all /bin/true +-.fi +- +-The "true" binary will be executed for all nodes and will succeed (exit 0) +-immediately. +- +-.B * +-To use manual fencing, use this line: +- +-.nf +-fence_all /bin/false +-.fi +- +-The "false" binary will be executed for all nodes and will fail (exit 1) +-immediately. +- +-When a node fails, manually run: dlm_tool fence_ack +- +-.B * +-To use stonith/pacemaker for fencing, use this line: +- +-.nf +-fence_all /usr/sbin/dlm_stonith +-.fi +- +-The "dlm_stonith" binary will be executed for all nodes. If +-stonith/pacemaker systems are not available, dlm_stonith will fail and +-this config becomes the equivalent of the previous /bin/false config. +- +-.B * +-To use an APC power switch, use these lines: +- +-.nf +-device apc /usr/sbin/fence_apc ipaddr=1.1.1.1 login=admin password=pw +-connect apc node=1 port=1 +-connect apc node=2 port=2 +-connect apc node=3 port=3 +-.fi +- +-Other network switch based agents are configured similarly. +- +-.B * +-To use sanlock/watchdog fencing, use these lines: +- +-.nf +-device wd /usr/sbin/fence_sanlock path=/dev/fence/leases +-connect wd node=1 host_id=1 +-connect wd node=2 host_id=2 +-unfence wd +-.fi +- +-See fence_sanlock(8) for more information. +- +-.B * +-For other fencing configurations see dlm.conf(5) man page. +- +-.PP +- +-.B 4. start dlm_controld on all nodes +- +-.nf +-systemctl start dlm +-.fi +- +-Run "dlm_tool status" to verify that all nodes are listed. +- +-.PP +- +-.B 5. if using clvm, start clvmd on all nodes +- +-systemctl clvmd start +- +-.PP +- +-.B 6. make new gfs2 file systems ++.B 1. Create the gfs2 filesystem + + mkfs.gfs2 -p lock_dlm -t cluster_name:fs_name -j num /path/to/storage + +-The cluster_name must match the name used in step 1 above. +-The fs_name must be a unique name in the cluster. +-The -j option is the number of journals to create, there must +-be one for each node that will mount the fs. ++The cluster_name must match the name configured in corosync (and thus dlm). ++The fs_name must be a unique name for the filesystem in the cluster. ++The -j option is the number of journals to create; there must ++be one for each node that will mount the filesystem. + + .PP ++.B 2. Mount the gfs2 filesystem + +-.B 7. mount gfs2 file systems ++If you are using a clustered resource manager, see its documentation for ++enabling a gfs2 filesystem resource. Otherwise, run: + + mount /path/to/storage /mountpoint + + Run "dlm_tool ls" to verify the nodes that have each fs mounted. + + .PP ++.B 3. Shut down + +-.B 8. shut down ++If you are using a clustered resource manager, see its documentation for ++disabling a gfs2 filesystem resource. Otherwise, run: + +-.nf + umount -a -t gfs2 +-systemctl clvmd stop +-systemctl dlm stop +-systemctl corosync stop +-.fi + + .PP ++.SH SEE ALSO + +-.B More setup information: +-.br +-.BR dlm_controld (8), +-.br +-.BR dlm_tool (8), +-.br +-.BR dlm.conf (5), +-.br +-.BR corosync (8), +-.br +-.BR corosync.conf (5) +-.br ++\fBmount\fP(8) and \fBumount\fP(8) for general mount information, ++\fBchmod\fP(1) and \fBchmod\fP(2) for access permission flags, ++\fBacl\fP(5) for access control lists, ++\fBlvm\fP(8) for volume management, ++\fBdlm_controld\fP(8), ++\fBdlm_tool\fP(8), ++\fBdlm.conf\fP(5), ++\fBcorosync\fP(8), ++\fBcorosync.conf\fP(5), diff --git a/SPECS/gfs2-utils.spec b/SPECS/gfs2-utils.spec new file mode 100644 index 0000000..274ce31 --- /dev/null +++ b/SPECS/gfs2-utils.spec @@ -0,0 +1,448 @@ +############################################################################### +############################################################################### +## +## Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. +## +## This copyrighted material is made available to anyone wishing to use, +## modify, copy, or redistribute it subject to the terms and conditions +## of the GNU General Public License v.2. +## +############################################################################### +############################################################################### + +Name: gfs2-utils +Version: 3.2.0 +Release: 7%{?dist} +License: GPLv2+ and LGPLv2+ +Group: System Environment/Kernel +Summary: Utilities for managing the global file system (GFS2) +%ifnarch %{arm} +%{?fedora:Requires: kmod(gfs2.ko) kmod(dlm.ko)} +%endif +BuildRequires: ncurses-devel +BuildRequires: kernel-headers +BuildRequires: automake +BuildRequires: libtool +BuildRequires: zlib-devel +BuildRequires: gettext-devel +BuildRequires: bison +BuildRequires: flex +BuildRequires: libblkid-devel +BuildRequires: libuuid-devel +BuildRequires: check-devel +Requires: lvm2-lockd +Source: https://releases.pagure.org/gfs2-utils/gfs2-utils-%{version}.tar.gz +URL: https://pagure.io/gfs2-utils +Patch0: bz1622050-1-fsck_gfs2_Don_t_check_fs_formats_we_don_t_recognise.patch +Patch1: bz1622050-2-libgfs2_Fix_pointer_cast_byte_order_issue.patch +Patch2: bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals.patch +Patch3: bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group.patch +Patch4: bz1757115-gfs2_5_General_updates_and_layout_improvements.patch +Patch5: bz1693000-fsck_gfs2_8_Manpage_updates.patch + +%prep +%setup -q -n gfs2-utils-%{version} +%patch0 -p1 -b .bz1622050-1-fsck_gfs2_Don_t_check_fs_formats_we_don_t_recognise +%patch1 -p1 -b .bz1622050-2-libgfs2_Fix_pointer_cast_byte_order_issue +%patch2 -p1 -b .bz1659490-gfs2_utils_Wrong_hash_value_used_to_clean_journals +%patch3 -p1 -b .bz1698858-mkfs_gfs2_Improve_alignment_of_first_resource_group +%patch4 -p1 -b .bz1757115-gfs2_5_General_updates_and_layout_improvements +%patch5 -p1 -b .bz1693000-fsck_gfs2_8_Manpage_updates + +%build +./autogen.sh +%configure +make %{_smp_mflags} V=1 + +%check +make check || { cat tests/testsuite.log; exit 1; } + +%install +make -C gfs2 install DESTDIR=%{buildroot} +# Don't ship gfs2_{trace,lockcapture} in this package +rm -f %{buildroot}/usr/sbin/gfs2_trace +rm -f %{buildroot}/usr/sbin/gfs2_lockcapture +rm -f %{buildroot}%{_mandir}/man8/gfs2_trace.8 +rm -f %{buildroot}%{_mandir}/man8/gfs2_lockcapture.8 + +%description +The gfs2-utils package contains a number of utilities for creating, checking, +modifying, and correcting inconsistencies in GFS2 file systems. + +%files +%doc doc/COPYING.* doc/COPYRIGHT doc/*.txt +%doc doc/README.contributing doc/README.licence +%{_sbindir}/fsck.gfs2 +%{_sbindir}/gfs2_grow +%{_sbindir}/gfs2_jadd +%{_sbindir}/mkfs.gfs2 +%{_sbindir}/gfs2_convert +%{_sbindir}/gfs2_edit +%{_sbindir}/tunegfs2 +%{_sbindir}/gfs2_withdraw_helper +%{_sbindir}/glocktop +%{_mandir}/man8/*gfs2* +%{_mandir}/man8/glocktop* +%{_mandir}/man5/* +%{_prefix}/lib/udev/rules.d/82-gfs2-withdraw.rules + +%changelog +* Fri Oct 18 2019 Andrew Price - 3.2.0-7 +- fsck.gfs2(8): Manpage updates + Resolves: rhbz#1693000 + +* Wed Oct 16 2019 Andrew Price - 3.2.0-6 +- gfs2.5: General updates and layout improvements + Resolves: rhbz#1757115 + +* Fri May 03 2019 Andrew Price - 3.2.0-5 +- mkfs.gfs2: Improve alignment of first resource group + Resolves: rhbz#1698858 + +* Fri Dec 14 2018 Andrew Price - 3.2.0-4 +- gfs2-utils: Wrong hash value used to clean journals + Resolves: rhbz#1659490 + +* Thu Nov 01 2018 Andrew Price - 3.2.0-3 +- Require lvm2-lockd + Resolves: rhbz#1642272 + +* Mon Oct 01 2018 Andrew Price - 3.2.0-2 +- fsck.gfs2: Don't check fs formats we don't recognise +- libgfs2: Fix pointer cast byte order issue + Resolves: rhbz#1622050 + +* Thu May 24 2018 Andrew Price - 3.2.0-1 +- New upstream release + +* Wed Feb 07 2018 Fedora Release Engineering - 3.1.10-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Fri Oct 13 2017 Andrew Price - 3.1.10-4 +- Update URL in spec file + +* Wed Aug 02 2017 Fedora Release Engineering - 3.1.10-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 3.1.10-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Mar 28 2017 Andrew Price - 3.1.10-1 +- New upstream release +- Make dependency on libuuid explicit + +* Fri Feb 10 2017 Fedora Release Engineering - 3.1.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Jun 07 2016 Andrew Price - 3.1.9-1 +- New upstream release +- Drop all patches +- Add glocktop to the package + +* Mon Feb 15 2016 Andrew Price - 3.1.8-7 +- libgfs2: Add support for dirent.de_rahead +- gfs2_edit: Include dirent.de_rahead in directory listings +- gfs2-utils: Add a check for the de_rahead field +- libgfs2: Support the new dirent de_cookie field + Resolves: bz#1307532 + +* Wed Feb 03 2016 Fedora Release Engineering - 3.1.8-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Aug 20 2015 Andrew Price - 3.1.8-5 +- Add patches to install the withdraw helper script properly: + scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch + scripts_install_the_withdraw_helper_script.patch + scripts_install_the_withdraw_udev_rules_script.patch +- Remove the obsolete udev script installation bits + +* Tue Aug 11 2015 Andrew Price - 3.1.8-4 +- gfs2-utils: Fix hang on withdraw +- Install udev withdraw handler scripts + +* Wed Jun 17 2015 Fedora Release Engineering - 3.1.8-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Apr 18 2015 Andrew Price - 3.1.8-2 +- fsck.gfs2: replace recent i_goal fixes with simple logic + +* Tue Apr 07 2015 Andrew Price - 3.1.8-1 +- New upstream release +- Remove perl dependency +- Update spec per the latest packaging guidelines + +* Mon Sep 08 2014 Andrew Price - 3.1.7-1 +- New upstream release +- Drop all patches +- gfs2-utils tests: Build unit tests with consistent cpp flags + +* Sat Aug 16 2014 Fedora Release Engineering - 3.1.6-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 3.1.6-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 15 2014 Josh Boyer - 3.1.6-7 +- Switch to using Requires on individual kernel modules + Resolves: bz#1056191 + +* Fri Mar 21 2014 Andrew Price - 3.1.6-6 +- gfs2_grow: Don't try to open an empty string +- libgfs2: Add lgfs2 open mnt functions +- Switch is pathname mounted callers to lgfs2 open mnt +- libgfs2 Remove is pathname mounted + Resolves: bz#1079286 + +* Fri Oct 04 2013 Andrew Price - 3.1.6-5 +- Suppress req on kernel-modules-extra for ARM arches. + +* Tue Sep 17 2013 Andrew Price - 3.1.6-4 +- Don't use README.* for docs (it can pick up some patch files) + +* Wed Aug 21 2013 Andrew Price - 3.1.6-3 +- Install utils into /usr/sbin instead of /sbin + Resolves: rhbz#996539 + +* Mon Jul 29 2013 Andrew Price - 3.1.6-2 +- Don't install gfs2_lockcapture and gfs2_trace + Resolves: rhbz#987019 +- Run test suite after build (requires check-devel build req) +- Install both of the READMEs into doc/ + +* Wed Jul 24 2013 Andrew Price - 3.1.6-1 +- New upstream release +- Drop 'file' requirement - mkfs.gfs2 now uses libblkid instead +- Drop 'ncurses' requirement - dependency is added automatically +- Drop requires chkconfig and initscripts - no longer installs daemons +- Drop fix_build_on_rawhide.patch - upstream +- Add build req on libblkid-devel + +* Wed Feb 13 2013 Fedora Release Engineering - 3.1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Nov 13 2012 Andrew Price - 3.1.5-1 +- New upstream release + Removes mount.gfs2, gfs2_tool, gfs2_quota +- Remove rawhide_transition.patch - now obsolete +- Update BuildRequires: + Change glibc-kernheaders to kernel-headers + Add bison and flex +- Provide a valid url for Source0 +- Add fix_build_on_rawhide.patch to fix a circular dep introduced in + bison 2.6, and a make -j race between libgfs2 and gfs2l + +* Tue Aug 14 2012 Andrew Price - 3.1.4-6 +- Make the kernel-modules-extra requirement Fedora-specific + Resolves bz#847955 + +* Thu Jul 19 2012 Fedora Release Engineering - 3.1.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Apr 17 2012 Andrew Price - 3.1.4-4 +- Remove commented-out sections +- Clean up some lintian warnings +- Add dependency on kernel-modules-extra as per bz#811547 + +* Wed Mar 07 2012 Andrew Price - 3.1.4-3 +- Remove redundant postinstall scriptlet + +* Thu Feb 2 2012 Fabio M. Di Nitto - 3.1.4-2 +- make sure to Obsolete gfs2-cluster + +* Wed Feb 01 2012 Andrew Price - 3.1.4-1 +- New upstream release + Adds gfs2_lockgather script +- Remove gfs2-cluster (commented out for now) +- Remove dependency on corosynclib-devel and systemd-units +- Add rawhide_transition.patch to stop gfs_controld from building + +* Fri Jan 13 2012 Fedora Release Engineering - 3.1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Thu Dec 15 2011 Andrew Price - 3.1.3-1 +- New upstream release + Bugfixes and improvements to fsck.gfs2 + Fixes various other bugs + Improve strings and translation support +- Adds gfs2-cluster systemd unit +- Removes gfs2* init scripts + +* Wed Jul 06 2011 Andrew Price - 3.1.2-1 +- New upstream release + Fixes several bugs + Improves translation support + Adds savemeta compression +- Add zlib-devel to BuildRequires +- Add gettext-devel to BuildRequires + +* Wed May 25 2011 Steven Whitehouse - 3.1.1-3 +- Update wiki URL +- Remove gfs2_tool and gfs2_quota from package + +* Fri Feb 25 2011 Bob Peterson - 3.1.1-2 +- Bumping release number to keep upgrades consistent. + +* Wed Feb 23 2011 Bob Peterson - 3.1.1-1 +- gfs2_edit savemeta doesn't save all leafs for big directories +- gfs2_edit improvements +- fsck.gfs2: can't repair rgrps resulting from gfs_grow->gfs2_convert +- fsck.gfs2: reports master/root dinodes as unused and fixes bitmap + +* Tue Feb 08 2011 Fedora Release Engineering - 3.1.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Jan 20 2011 Steven Whitehouse - 3.1.0-4 +- Drop mount.gfs2 and its man page +- Only list gfs2_tool once in the files list + +* Wed Dec 8 2010 Fabio M. Di Nitto - 3.1.0-3 +- Drop circular dependency on cman + +* Fri Dec 3 2010 Fabio M. Di Nitto - 3.1.0-2 +- gfs2-cluster should Obsoletes/Provides gfs-pcmk + +* Tue Sep 30 2010 Steven Whitehouse - 3.1.0-1 +- Bringing this package back for upstream GFS2 + Addition of gfs2tune to the utils + Merge of gfs_controld from cman + +* Thu Jan 22 2009 Fabio M. Di Nitto - 2.03.11-1 +- New upstream release + Fix several bugs and drastically improve startup errors. + +* Wed Dec 10 2008 Fabio M. Di Nitto - 2.03.10-1 +- New upstream release + Fix several bugs and port gfs1 code to match 2.6.27 kernel. + +* Fri Oct 31 2008 Fabio M. Di Nitto - 2.03.09-1 +- New upstream release + Fix rhbz#468966 + Addresses several security issues similar to CVE-2008-4192 and + CVE-2008-4579 after deep code audit from upstream +- cleanup patches to match 2.6.26 kernel in F-9 + +* Tue Oct 21 2008 Fabio M. Di Nitto - 2.03.08-1 +- New upstream release + Fix rhbz#460376 CVE-2008-4192 + Fix rhbz#467386 CVE-2008-4579 +- cleanup/update patches to match 2.6.26 kernel in F-9 + +* Thu Aug 14 2008 Fabio M. Di Nitto - 2.03.07-1 +- New upstream release +- Fix rgmanager startup locking issues +- Apply patch to include kernel headers from 2.6.26 required to build + userland. Userland will run in 2.6.25 compatibility mode +- Apply patch to keep kernel modules at 2.6.25 (upstream is at 2.6.26) + (this patch is purely cosmetic since we don't build kernel modules + but keep the source in sync is Good (tm)) +- Cleanup packaging for installed docs and file permissions + +* Mon Jul 14 2008 Fabio M. Di Nitto - 2.03.05-1 +- New upstream release +- Cleanup installed doc after upstream + +* Wed Jun 11 2008 Fabio M. Di Nitto 2.03.04-1 +- New upstream release +- Resolves: #446995 #318271 #447378 #445662 +- Update license tags after major upstream cleanup +- Include COPYRIGHT file + +* Fri May 30 2008 Fabio M. Di Nitto 2.03.03-1 +- New upstream release +- Fix several build warnings +- Update spec files to use macros +- Update Requires to use packages rather than pointing at files +- Drop BR on kernel-devel since it's not required anymore +- Update build section to use proper _sysconfdir, libdir and sbindir +- Avoid abusing cd when we can ask make to do the work for us +- Remove /usr/sbin from file section. We don't have any file there + and we can avoid shipping stuff by mistake + +* Mon Apr 14 2008 Steven Whitehouse 2.03.00-3 +- Fabbione saves the day. We can get rid of the sed stuff after all + +* Mon Apr 14 2008 Steven Whitehouse 2.03.00-1 +- New upstream sources +- Eric Sandeen's solution to kernel version dep + +* Wed Apr 09 2008 Steven Whitehouse 0.1.25.2.02.01-15 +- Remove obsolete chkconfig patch for initscript +- Enable parallel make +- Remove obsolete copy of gfs2_ondisk.h (this should be in glibc-kernheaders) + +* Wed Apr 09 2008 Steven Whitehouse 0.1.25.2.02.01-14 +- Update URL +- Fix license spec + +* Fri Mar 14 2008 Chris Feist 0.1.25.2.02.00-2 +- New upstream sources. + +* Tue Jan 16 2007 Chris Feist 0.1.24-1 +- New upstream sources. +- Resolves: rhbz#222747 + +* Wed Jan 03 2007 Chris Feist 0.1.24-1 +- Updated sources +- Resolves: rhbz#218560 + +* Thu Dec 21 2006 Chris Feist 0.1.23-1 +- Updated sources +- Resolves: rhbz#218560 + +* Tue Dec 19 2006 Chris Feist 0.1.22-1 +- New upstream sources. +- Resolves: rhbz#219878 + +* Tue Dec 04 2006 Chris Feist 0.1.21-1 +- New upstream sources. +- Resolves: rhbz#218134 rhbz#215962 + +* Thu Nov 30 2006 Chris Feist 0.1.19-1 +- New upstream sources. +- Resolves: rhbz#217798 + +* Wed Nov 29 2006 Chris Feist 0.1.18-1 +- New upstream sources. +- Resolves: rhbz#217460 + +* Thu Oct 26 2006 Chris Feist 0.1.14-1 +- New upstream sources. + +* Fri Oct 13 2006 Chris Feist 0.1.12-1 +- New Upstream sources. + +* Fri Oct 13 2006 Chris Feist 0.1.10-1 +- New Upstream sources. + +* Mon Oct 09 2006 Chris Feist 0.1.9-1 +- New Upstream sources. + +* Mon Sep 25 2006 Chris Feist 0.1.8-1 +- New Upstream sources. + +* Wed Sep 13 2006 Chris Feist 0.1.7-1 +- New Upstream sources. + +* Thu Sep 07 2006 Chris Feist 0.1.6-2 +- Fix typo in uninstall script (turn off gfs2 instead of gfs) + +* Mon Aug 28 2006 Chris Feist 0.1.6-1 +- New Upstream sources. + +* Tue Aug 22 2006 Chris Feist 0.1.5-1 +- New Upstream sources. + +* Mon Aug 14 2006 Chris Feist 0.1.3-0 +- New Upstream sources, use dist tag. + +* Fri Jul 14 2006 Chris Feist +- Rebuild with updated sources + +* Wed Jul 12 2006 Jesse Keating +- rebuild + +* Tue Jun 27 2006 Florian La Roche +- fix typo in preun script + +* Fri Jun 09 2006 Chris Feist - 0.1.0-1.fc6.3 +- Initial build of gfs-utils.