diff --git a/.gitignore b/.gitignore index 0937feb..6f5f323 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ /gfs2-utils-3.1.6.tar.gz /gfs2-utils-3.1.7.tar.gz /gfs2-utils-3.1.8.tar.gz +/gfs2-utils-3.1.9.tar.gz diff --git a/1307532-1-libgfs2_Add_support_for_dirent_de_rahead.patch b/1307532-1-libgfs2_Add_support_for_dirent_de_rahead.patch deleted file mode 100644 index 23e9e44..0000000 --- a/1307532-1-libgfs2_Add_support_for_dirent_de_rahead.patch +++ /dev/null @@ -1,43 +0,0 @@ -commit 3141e81ae6eef9c2fa1de36929140ec122c70805 -Author: Andreas Gruenbacher -Date: Wed Sep 9 17:55:29 2015 +0200 - - libgfs2: Add support for dirent.de_rahead - - This field indicates how many blocks of metadata can be read ahead when reading - in the inode a directory entry points at. - - Signed-off-by: Andreas Gruenbacher - -diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c -index 79de64d..70daec4 100644 ---- a/gfs2/libgfs2/meta.c -+++ b/gfs2/libgfs2/meta.c -@@ -428,6 +428,7 @@ F(de_hash, .flags = LGFS2_MFF_CHECK) - F(de_rec_len, .flags = LGFS2_MFF_BYTES) - F(de_name_len, .flags = LGFS2_MFF_BYTES) - F(de_type) -+F(de_rahead) - RF(__pad) - }; - -diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c -index 4744337..7f34bd2 100644 ---- a/gfs2/libgfs2/ondisk.c -+++ b/gfs2/libgfs2/ondisk.c -@@ -415,6 +415,7 @@ void gfs2_dirent_in(struct gfs2_dirent *de, char *buf) - CPIN_16(de, str, de_rec_len); - CPIN_16(de, str, de_name_len); - CPIN_16(de, str, de_type); -+ CPIN_16(de, str, de_rahead); - } - - void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) -@@ -427,6 +428,7 @@ void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) - CPOUT_16(de, str, de_name_len); - CPOUT_16(de, str, de_type); - memset(str->__pad, 0, sizeof(str->__pad)); -+ CPOUT_16(de, str, de_rahead); - } - - void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh) diff --git a/1307532-2-gfs2_edit_Include_dirent_de_rahead_in_directory_listings.patch b/1307532-2-gfs2_edit_Include_dirent_de_rahead_in_directory_listings.patch deleted file mode 100644 index 9d3a4f0..0000000 --- a/1307532-2-gfs2_edit_Include_dirent_de_rahead_in_directory_listings.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit dcd8296e142d3bd69e1a1bda2c096ed78fe4888f -Author: Andreas Gruenbacher -Date: Wed Sep 9 17:55:30 2015 +0200 - - gfs2_edit: Include dirent.de_rahead in directory listings - - When dumping a directory, for directory each entry, also print how many blocks - of metadata can be read ahead when reading in the inode the entry points at. - - Signed-off-by: Andreas Gruenbacher - -diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c -index e5cb12c..b1826a1 100644 ---- a/gfs2/edit/extended.c -+++ b/gfs2/edit/extended.c -@@ -342,13 +342,14 @@ static int display_leaf(struct iinfo *ind) - strcpy(edit_fmt, "%llx"); - } - } -- print_gfs2("%d/%d [%08x] %lld/%lld (0x%llx/0x%llx): ", -+ print_gfs2("%d/%d [%08x] %lld/%lld (0x%llx/0x%llx) +%u: ", - total_dirents, d + 1, - ind->ii[0].dirent[d].dirent.de_hash, - ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino, - ind->ii[0].dirent[d].block, - ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino, -- ind->ii[0].dirent[d].block); -+ ind->ii[0].dirent[d].block, -+ (unsigned int)ind->ii[0].dirent[d].dirent.de_rahead); - } - print_inode_type(ind->ii[0].dirent[d].dirent.de_type); - print_gfs2(" %s", ind->ii[0].dirent[d].filename); diff --git a/1307532-3-gfs2_utils_Add_a_check_for_the_de_rahead_field.patch b/1307532-3-gfs2_utils_Add_a_check_for_the_de_rahead_field.patch deleted file mode 100644 index 37f6e7b..0000000 --- a/1307532-3-gfs2_utils_Add_a_check_for_the_de_rahead_field.patch +++ /dev/null @@ -1,83 +0,0 @@ -commit 471bc208c8e29013b2abb66f36d6e6d9ef4e4337 -Author: Andrew Price -Date: Thu Sep 10 11:33:24 2015 +0100 - - gfs2-utils: Add a check for the de_rahead field - - gfs2_dirent.de_rahead first appeared in Linux 3.15. Support prior - versions by checking for de_rahead and using it conditionally. - - Signed-off-by: Andrew Price - -diff --git a/configure.ac b/configure.ac -index 35cafe6..a5418aa 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -125,6 +125,8 @@ AC_CHECK_HEADER([linux/gfs2_ondisk.h], [], [AC_MSG_ERROR([Unable to find linux/g - AC_CHECK_MEMBER([struct gfs2_sb.sb_uuid], [], [], [[#include ]]) - AC_CHECK_MEMBER([struct gfs2_leaf.lf_inode],[AC_DEFINE([GFS2_HAS_LEAF_HINTS],[],[Leaf block hints])], - [], [[#include ]]) -+AC_CHECK_MEMBER([struct gfs2_dirent.de_rahead],[AC_DEFINE([GFS2_HAS_DE_RAHEAD],[],[Dirent readahead field])], -+ [], [[#include ]]) - - # *FLAGS handling - ENV_CFLAGS="$CFLAGS" -diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c -index b1826a1..a13827e 100644 ---- a/gfs2/edit/extended.c -+++ b/gfs2/edit/extended.c -@@ -349,7 +349,12 @@ static int display_leaf(struct iinfo *ind) - ind->ii[0].dirent[d].block, - ind->ii[0].dirent[d].dirent.de_inum.no_formal_ino, - ind->ii[0].dirent[d].block, -- (unsigned int)ind->ii[0].dirent[d].dirent.de_rahead); -+#ifdef GFS2_HAS_DE_RAHEAD -+ (unsigned int)ind->ii[0].dirent[d].dirent.de_rahead -+#else -+ 0 -+#endif -+ ); - } - print_inode_type(ind->ii[0].dirent[d].dirent.de_type); - print_gfs2(" %s", ind->ii[0].dirent[d].filename); -diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c -index 70daec4..4f43af5 100644 ---- a/gfs2/libgfs2/meta.c -+++ b/gfs2/libgfs2/meta.c -@@ -428,8 +428,12 @@ F(de_hash, .flags = LGFS2_MFF_CHECK) - F(de_rec_len, .flags = LGFS2_MFF_BYTES) - F(de_name_len, .flags = LGFS2_MFF_BYTES) - F(de_type) -+#ifdef GFS2_HAS_DE_RAHEAD - F(de_rahead) -+RF(__pad2) -+#else - RF(__pad) -+#endif - }; - - #undef STRUCT -diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c -index 7f34bd2..b9418c5 100644 ---- a/gfs2/libgfs2/ondisk.c -+++ b/gfs2/libgfs2/ondisk.c -@@ -415,7 +415,9 @@ void gfs2_dirent_in(struct gfs2_dirent *de, char *buf) - CPIN_16(de, str, de_rec_len); - CPIN_16(de, str, de_name_len); - CPIN_16(de, str, de_type); -+#ifdef GFS2_HAS_DE_RAHEAD - CPIN_16(de, str, de_rahead); -+#endif - } - - void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) -@@ -428,7 +430,9 @@ void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) - CPOUT_16(de, str, de_name_len); - CPOUT_16(de, str, de_type); - memset(str->__pad, 0, sizeof(str->__pad)); -+#ifdef GFS2_HAS_DE_RAHEAD - CPOUT_16(de, str, de_rahead); -+#endif - } - - void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh) diff --git a/1307532-4-libgfs2_Support_the_new_dirent_de_cookie_field.patch b/1307532-4-libgfs2_Support_the_new_dirent_de_cookie_field.patch deleted file mode 100644 index 4bf86bb..0000000 --- a/1307532-4-libgfs2_Support_the_new_dirent_de_cookie_field.patch +++ /dev/null @@ -1,106 +0,0 @@ -commit da2bced4ff2a8fa9c95fde8071f2f164c0c1466a -Author: Andrew Price -Date: Mon Feb 15 12:42:51 2016 +0000 - - libgfs2: Support the new dirent de_cookie field - - Detect whether the new de_cookie field (kernel commit 471f3db27) is - present in struct gfs2_dirent in the configure script and update the - metadata description to support that field. - - It also seems that meta.c was not using the GFS2_HAS_* defines from - clusterautoconfig.h and that was causing a unit test to fail with - - gfs2_dirent: __pad: offset is 28, expected 26 - gfs2_dirent: size mismatch between struct 40 and fields 38 - - This commit adds an #include to fix that. - - Fixes Rawhide bz#1307532 - - Signed-off-by: Andrew Price - -diff --git a/configure.ac b/configure.ac -index 130cb01..f6174ff 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -127,6 +127,8 @@ AC_CHECK_MEMBER([struct gfs2_leaf.lf_inode],[AC_DEFINE([GFS2_HAS_LEAF_HINTS],[], - [], [[#include ]]) - AC_CHECK_MEMBER([struct gfs2_dirent.de_rahead],[AC_DEFINE([GFS2_HAS_DE_RAHEAD],[],[Dirent readahead field])], - [], [[#include ]]) -+AC_CHECK_MEMBER([struct gfs2_dirent.de_cookie],[AC_DEFINE([GFS2_HAS_DE_COOKIE],[],[Dirent cookie field])], -+ [], [[#include ]]) - - # *FLAGS handling - ENV_CFLAGS="$CFLAGS" -diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c -index 4f43af5..90d5647 100644 ---- a/gfs2/libgfs2/meta.c -+++ b/gfs2/libgfs2/meta.c -@@ -1,6 +1,7 @@ - #include - #include - #include "libgfs2.h" -+#include "clusterautoconfig.h" - - #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) - #define SYM(x) { x, #x }, -@@ -430,10 +431,15 @@ F(de_name_len, .flags = LGFS2_MFF_BYTES) - F(de_type) - #ifdef GFS2_HAS_DE_RAHEAD - F(de_rahead) --RF(__pad2) -+#ifdef GFS2_HAS_DE_COOKIE -+F(de_cookie) -+RF(pad3) -+#else -+RF(pad2) -+#endif /* GFS2_HAS_DE_COOKIE */ - #else - RF(__pad) --#endif -+#endif /* GFS2_HAS_DE_RAHEAD */ - }; - - #undef STRUCT -diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c -index b9418c5..ea1f61f 100644 ---- a/gfs2/libgfs2/ondisk.c -+++ b/gfs2/libgfs2/ondisk.c -@@ -417,7 +417,15 @@ void gfs2_dirent_in(struct gfs2_dirent *de, char *buf) - CPIN_16(de, str, de_type); - #ifdef GFS2_HAS_DE_RAHEAD - CPIN_16(de, str, de_rahead); --#endif -+#ifdef GFS2_HAS_DE_COOKIE -+ CPIN_32(de, str, de_cookie); -+ CPIN_08(de, str, pad3, 8); -+#else -+ CPIN_08(de, str, pad2, 12); -+#endif /* GFS2_HAS_DE_COOKIE */ -+#else -+ CPIN_08(de, str, __pad, 14); -+#endif /* GFS2_HAS_DE_RAHEAD */ - } - - void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) -@@ -429,10 +437,17 @@ void gfs2_dirent_out(struct gfs2_dirent *de, char *buf) - CPOUT_16(de, str, de_rec_len); - CPOUT_16(de, str, de_name_len); - CPOUT_16(de, str, de_type); -- memset(str->__pad, 0, sizeof(str->__pad)); - #ifdef GFS2_HAS_DE_RAHEAD - CPOUT_16(de, str, de_rahead); --#endif -+#ifdef GFS2_HAS_DE_COOKIE -+ CPOUT_32(de, str, de_cookie); -+ CPOUT_08(de, str, pad3, 8); -+#else -+ CPOUT_08(de, str, pad2, 12); -+#endif /* GFS2_HAS_DE_COOKIE */ -+#else -+ CPOUT_08(de, str, __pad, 14); -+#endif /* GFS2_HAS_DE_RAHEAD */ - } - - void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh) diff --git a/fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic.patch b/fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic.patch deleted file mode 100644 index 7411fd8..0000000 --- a/fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic.patch +++ /dev/null @@ -1,304 +0,0 @@ -commit f1028ec054f2d7f85a449b2bf0894e0435c01d6a -Author: Abhi Das -Date: Tue Apr 14 19:51:55 2015 -0500 - - fsck.gfs2: replace recent i_goal fixes with simple logic - - This patch reverses the recent set of i_goal fixes for fsck.gfs2. - This is because of two problems. - 1. It is not possible to determine if a valid block within the fs - is the correct goal block for a given inode. - 2. Conversely, given an inode, it is also not possible to accurately - determine what its goal block should be. - - The previous patches assumed that the last block of a file is its - goal block, but that is not true if the file is a directory or if - its blocks are not allocated sequentially. fsck.gfs2 would flag - these inodes incorrectly as having bad i_goal values. - - This patch takes a simple approach. It checks if the i_goal of a - given inode is out of bounds of the fs. If so, we can be certain - that it is wrong and we set it to the inode metadata block. This - is a safe starting point for gfs2 to determine where to allocate - from next. - - Resolves: rhbz#1186515 - Signed-off-by: Abhi Das - -diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c -index f05fb51..4d5a660 100644 ---- a/gfs2/fsck/metawalk.c -+++ b/gfs2/fsck/metawalk.c -@@ -1428,8 +1428,7 @@ static int build_and_check_metalist(struct gfs2_inode *ip, osi_list_t *mlp, - */ - static int check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass, - struct gfs2_buffer_head *bh, int head_size, -- uint64_t *last_block, uint64_t *blks_checked, -- uint64_t *error_blk) -+ uint64_t *blks_checked, uint64_t *error_blk) - { - int error = 0, rc = 0; - uint64_t block, *ptr; -@@ -1444,7 +1443,7 @@ static int check_data(struct gfs2_inode *ip, struct metawalk_fxns *pass, - - if (skip_this_pass || fsck_abort) - return error; -- *last_block = block = be64_to_cpu(*ptr); -+ block = be64_to_cpu(*ptr); - /* It's important that we don't call valid_block() and - bypass calling check_data on invalid blocks because that - would defeat the rangecheck_block related functions in -@@ -1548,15 +1547,12 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass) - struct gfs2_buffer_head *bh; - uint32_t height = ip->i_di.di_height; - int i, head_size; -- uint64_t blks_checked = 0, last_block = 0; -+ uint64_t blks_checked = 0; - int error, rc; - int metadata_clean = 0; - uint64_t error_blk = 0; - int hit_error_blk = 0; - -- if (!height && pass->check_i_goal) -- pass->check_i_goal(ip, ip->i_di.di_num.no_addr, -- pass->private); - if (!height && !is_dir(&ip->i_di, ip->i_sbd->gfs1)) - return 0; - -@@ -1575,9 +1571,6 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass) - * comprise the directory hash table, so we perform the directory - * checks and exit. */ - if (is_dir(&ip->i_di, ip->i_sbd->gfs1)) { -- last_block = ip->i_di.di_num.no_addr; -- if (pass->check_i_goal) -- pass->check_i_goal(ip, last_block, pass->private); - if (!(ip->i_di.di_flags & GFS2_DIF_EXHASH)) - goto out; - /* check validity of leaf blocks and leaf chains */ -@@ -1604,7 +1597,7 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass) - - if (pass->check_data) - error = check_data(ip, pass, bh, head_size, -- &last_block, &blks_checked, &error_blk); -+ &blks_checked, &error_blk); - if (pass->big_file_msg && ip->i_di.di_blocks > COMFORTABLE_BLKS) - pass->big_file_msg(ip, blks_checked); - } -@@ -1616,8 +1609,6 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass) - (unsigned long long)ip->i_di.di_num.no_addr); - fflush(stdout); - } -- if (!error && pass->check_i_goal) -- pass->check_i_goal(ip, last_block, pass->private); - undo_metalist: - if (!error) - goto out; -@@ -1958,80 +1949,6 @@ static int alloc_leaf(struct gfs2_inode *ip, uint64_t block, void *private) - return 0; - } - --/** -- * rgrp_contains_block - Check if the rgrp provided contains the -- * given block. Taken directly from the gfs2 kernel code -- * @rgd: The rgrp to search within -- * @block: The block to search for -- * -- * Returns: 1 if present, 0 if not. -- */ --static inline int rgrp_contains_block(struct rgrp_tree *rgd, uint64_t block) --{ -- uint64_t first = rgd->ri.ri_data0; -- uint64_t last = first + rgd->ri.ri_data; -- return first <= block && block < last; --} -- --/** -- * check_i_goal -- * @ip -- * @goal_blk: What the goal block should be for this inode -- * -- * The goal block for a regular file is typically the last -- * data block of the file. If we can't get the right value, -- * the inode metadata block is the next best thing. -- * -- * Returns: 0 if corrected, 1 if not corrected -- */ --int check_i_goal(struct gfs2_inode *ip, uint64_t goal_blk, -- void *private) --{ -- struct gfs2_sbd *sdp = ip->i_sbd; -- uint64_t i_block = ip->i_di.di_num.no_addr; -- -- /* Don't fix gfs1 inodes, system inodes or inodes whose goal blocks are -- * set to the inode blocks themselves. */ -- if (sdp->gfs1 || ip->i_di.di_flags & GFS2_DIF_SYSTEM || -- ip->i_di.di_goal_meta == i_block) -- return 0; -- /* Don't fix directory goal blocks unless we know they're wrong. -- * i.e. out of bounds of the fs. Directories can easily have blocks -- * outside of the dinode's rgrp and thus we have no way of knowing -- * if the goal block is bogus or not. */ -- if (is_dir(&ip->i_di, ip->i_sbd->gfs1) && -- (ip->i_di.di_goal_meta > sdp->sb_addr && -- ip->i_di.di_goal_meta <= sdp->fssize)) -- return 0; -- /* We default to the inode block */ -- if (!goal_blk) -- goal_blk = i_block; -- -- if (ip->i_di.di_goal_meta != goal_blk) { -- /* If the existing goal block is in the same rgrp as the inode, -- * we give the benefit of doubt and assume the value is correct */ -- if (ip->i_rgd && -- rgrp_contains_block(ip->i_rgd, ip->i_di.di_goal_meta)) -- goto skip; -- log_err( _("Error: inode %llu (0x%llx) has invalid " -- "allocation goal block %llu (0x%llx). Should" -- " be %llu (0x%llx)\n"), -- (unsigned long long)i_block, (unsigned long long)i_block, -- (unsigned long long)ip->i_di.di_goal_meta, -- (unsigned long long)ip->i_di.di_goal_meta, -- (unsigned long long)goal_blk, (unsigned long long)goal_blk); -- if (query( _("Fix the invalid goal block? (y/n) "))) { -- ip->i_di.di_goal_meta = ip->i_di.di_goal_data = goal_blk; -- bmodified(ip->i_bh); -- } else { -- log_err(_("Invalid goal block not fixed.\n")); -- return 1; -- } -- } --skip: -- return 0; --} -- - struct metawalk_fxns alloc_fxns = { - .private = NULL, - .check_leaf = alloc_leaf, -@@ -2042,7 +1959,6 @@ struct metawalk_fxns alloc_fxns = { - .check_dentry = NULL, - .check_eattr_entry = NULL, - .check_eattr_extentry = NULL, -- .check_i_goal = check_i_goal, - .finish_eattr_indir = NULL, - }; - -diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h -index 779360e..fa4c850 100644 ---- a/gfs2/fsck/metawalk.h -+++ b/gfs2/fsck/metawalk.h -@@ -50,8 +50,6 @@ extern int _fsck_blockmap_set(struct gfs2_inode *ip, uint64_t bblock, - const char *caller, int line); - extern int check_n_fix_bitmap(struct gfs2_sbd *sdp, uint64_t blk, - int error_on_dinode, int new_blockmap_state); --extern int check_i_goal(struct gfs2_inode *ip, uint64_t goal_blk, -- void *private); - extern void reprocess_inode(struct gfs2_inode *ip, const char *desc); - extern struct duptree *dupfind(uint64_t block); - extern struct gfs2_inode *fsck_system_inode(struct gfs2_sbd *sdp, -@@ -91,7 +89,6 @@ enum meta_check_rc { - * check_dentry: - * check_eattr_entry: - * check_eattr_extentry: -- * check_i_goal: - */ - struct metawalk_fxns { - void *private; -@@ -143,8 +140,6 @@ struct metawalk_fxns { - struct gfs2_ea_header *ea_hdr, - struct gfs2_ea_header *ea_hdr_prev, - void *private); -- int (*check_i_goal) (struct gfs2_inode *ip, uint64_t goal_blk, -- void *private); - int (*finish_eattr_indir) (struct gfs2_inode *ip, int leaf_pointers, - int leaf_pointer_errors, void *private); - void (*big_file_msg) (struct gfs2_inode *ip, uint64_t blks_checked); -diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c -index 69c88f4..0909873 100644 ---- a/gfs2/fsck/pass1.c -+++ b/gfs2/fsck/pass1.c -@@ -100,7 +100,6 @@ struct metawalk_fxns pass1_fxns = { - .check_dentry = NULL, - .check_eattr_entry = check_eattr_entries, - .check_eattr_extentry = check_extended_leaf_eattr, -- .check_i_goal = check_i_goal, - .finish_eattr_indir = finish_eattr_indir, - .big_file_msg = big_file_comfort, - .repair_leaf = pass1_repair_leaf, -@@ -1205,12 +1204,37 @@ bad_dinode: - return -1; - } - -+static void check_i_goal(struct gfs2_sbd *sdp, struct gfs2_inode *ip) -+{ -+ if (sdp->gfs1 || ip->i_di.di_flags & GFS2_DIF_SYSTEM) -+ return; -+ -+ if (ip->i_di.di_goal_meta <= sdp->sb_addr || -+ ip->i_di.di_goal_meta > sdp->fssize) { -+ log_err(_("Inode #%llu (0x%llx): Bad allocation goal block " -+ "found: %llu (0x%llx)\n"), -+ (unsigned long long)ip->i_di.di_num.no_addr, -+ (unsigned long long)ip->i_di.di_num.no_addr, -+ (unsigned long long)ip->i_di.di_goal_meta, -+ (unsigned long long)ip->i_di.di_goal_meta); -+ if (query( _("Fix goal block in inode #%llu (0x%llx)? (y/n) "), -+ (unsigned long long)ip->i_di.di_num.no_addr, -+ (unsigned long long)ip->i_di.di_num.no_addr)) { -+ ip->i_di.di_goal_meta = ip->i_di.di_num.no_addr; -+ bmodified(ip->i_bh); -+ } else -+ log_err(_("Allocation goal block in inode #%lld " -+ "(0x%llx) not fixed\n"), -+ (unsigned long long)ip->i_di.di_num.no_addr, -+ (unsigned long long)ip->i_di.di_num.no_addr); -+ } -+} -+ - /* - * handle_di - This is now a wrapper function that takes a gfs2_buffer_head - * and calls handle_ip, which takes an in-code dinode structure. - */ --static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, -- struct rgrp_tree *rgd) -+static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh) - { - int error = 0; - uint64_t block = bh->b_blocknr; -@@ -1252,7 +1276,7 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh, - (unsigned long long)block, - (unsigned long long)block); - } -- ip->i_rgd = rgd; -+ check_i_goal(sdp, ip); - error = handle_ip(sdp, ip); - fsck_inode_put(&ip); - return error; -@@ -1378,6 +1402,7 @@ static int check_system_inode(struct gfs2_sbd *sdp, - "directory entries.\n"), filename); - } - } -+ check_i_goal(sdp, *sysinode); - error = handle_ip(sdp, *sysinode); - return error ? error : err; - } -@@ -1602,7 +1627,7 @@ static int pass1_process_bitmap(struct gfs2_sbd *sdp, struct rgrp_tree *rgd, uin - (unsigned long long)block, - (unsigned long long)block); - check_n_fix_bitmap(sdp, block, 0, GFS2_BLKST_FREE); -- } else if (handle_di(sdp, bh, rgd) < 0) { -+ } else if (handle_di(sdp, bh) < 0) { - stack; - brelse(bh); - gfs2_special_free(&gfs1_rindex_blks); -diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h -index f1f81d3..ccae721 100644 ---- a/gfs2/libgfs2/libgfs2.h -+++ b/gfs2/libgfs2/libgfs2.h -@@ -233,7 +233,6 @@ struct gfs2_inode { - struct gfs2_dinode i_di; - struct gfs2_buffer_head *i_bh; - struct gfs2_sbd *i_sbd; -- struct rgrp_tree *i_rgd; /* The rgrp this inode is in */ - }; - - struct master_dir diff --git a/gfs2-utils.spec b/gfs2-utils.spec index 47d4ea1..8017e7c 100644 --- a/gfs2-utils.spec +++ b/gfs2-utils.spec @@ -1,7 +1,7 @@ ############################################################################### ############################################################################### ## -## Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved. +## Copyright (C) 2004-2016 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 @@ -11,8 +11,8 @@ ############################################################################### Name: gfs2-utils -Version: 3.1.8 -Release: 7%{?dist} +Version: 3.1.9 +Release: 1%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Kernel Summary: Utilities for managing the global file system (GFS2) @@ -31,28 +31,9 @@ BuildRequires: libblkid-devel BuildRequires: check-devel Source: https://fedorahosted.org/released/gfs2-utils/gfs2-utils-%{version}.tar.gz URL: https://fedorahosted.org/cluster/wiki/HomePage -Patch0: fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic.patch -Patch1: gfs2_utils_Fix_hang_on_withdraw.patch -Patch2: scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch -Patch3: scripts_install_the_withdraw_helper_script.patch -Patch4: scripts_install_the_withdraw_udev_rules_script.patch -Patch5: 1307532-1-libgfs2_Add_support_for_dirent_de_rahead.patch -Patch6: 1307532-2-gfs2_edit_Include_dirent_de_rahead_in_directory_listings.patch -Patch7: 1307532-3-gfs2_utils_Add_a_check_for_the_de_rahead_field.patch -Patch8: 1307532-4-libgfs2_Support_the_new_dirent_de_cookie_field.patch - %prep %setup -q -n gfs2-utils-%{version} -%patch0 -p 1 -b .fsck_gfs2_replace_recent_i_goal_fixes_with_simple_logic -%patch1 -p 1 -b .gfs2_utils_Fix_hang_on_withdraw -%patch2 -p 1 -b .scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper -%patch3 -p 1 -b .scripts_install_the_withdraw_helper_script -%patch4 -p 1 -b .scripts_install_the_withdraw_udev_rules_script -%patch5 -p 1 -b .1307532-1-libgfs2_Add_support_for_dirent_de_rahead -%patch6 -p 1 -b .1307532-2-gfs2_edit_Include_dirent_de_rahead_in_directory_listings -%patch7 -p 1 -b .1307532-3-gfs2_utils_Add_a_check_for_the_de_rahead_field -%patch8 -p 1 -b .1307532-4-libgfs2_Support_the_new_dirent_de_cookie_field %build ./autogen.sh @@ -71,9 +52,8 @@ 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 any inconsistencies in GFS2 -file systems. +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 @@ -86,11 +66,18 @@ file systems. %{_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 +* 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 diff --git a/gfs2_utils_Fix_hang_on_withdraw.patch b/gfs2_utils_Fix_hang_on_withdraw.patch deleted file mode 100644 index 2d2f051..0000000 --- a/gfs2_utils_Fix_hang_on_withdraw.patch +++ /dev/null @@ -1,97 +0,0 @@ -commit 4e9a8f12b74d61314e79904a0f02e42e99a98493 -Author: Abhi Das -Date: Tue Aug 4 11:00:51 2015 -0500 - - gfs2-utils: Fix hang on withdraw - - Issuing a withdraw on a gfs2 filesystem causes a hang. When - gfs_controld was removed, the userspace functionality that - completes a withdraw operation went away. This causes gfs2 - kernel to hang waiting for a withdraw completion ack from - userspace. - - This patchset introduces a uevent-based shell script to do - the job that gfs_controld used to do on withdraw. An 'offline' - uevent triggers the execution of this script. This script - suspends the device associated with the filesystem and signals - a completed withdraw to the kernel. - - Resolves: rhbz#1225634 - Signed-off-by: Abhi Das - -diff --git a/README.build b/README.build -index f4ebe53..6487bae 100644 ---- a/README.build -+++ b/README.build -@@ -29,5 +29,14 @@ To install gfs2-utils, run: - - make install - -+The following scripts (located in gfs2/scripts) are used to complete -+the userland portion of the gfs2 withdraw feature using uevents. They -+are not installed by 'make install' and need to be installed manually -+or during rpm installation to the corresponding locations. -+ -+ 82-gfs2-withdraw.rules in /etc/udev/rules.d/ -+ gfs2_wd_udev.sh in /usr/sbin/ -+ - See also doc/README.contributing for details on submitting patches and - doc/README.tests for more details regarding the test suite. -+ -diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules -new file mode 100644 -index 0000000..2228615 ---- /dev/null -+++ b/gfs2/scripts/82-gfs2-withdraw.rules -@@ -0,0 +1,2 @@ -+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh" -+ -diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am -index 62fb2fe..dde906f 100644 ---- a/gfs2/scripts/Makefile.am -+++ b/gfs2/scripts/Makefile.am -@@ -3,3 +3,8 @@ MAINTAINERCLEANFILES = Makefile.in - dist_sbin_SCRIPTS = \ - gfs2_lockcapture \ - gfs2_trace -+ -+noinst_SCRIPTS = \ -+ 82-gfs2-withdraw.rules \ -+ gfs2_wd_udev.sh -+ -diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh -new file mode 100755 -index 0000000..ac3ce35 ---- /dev/null -+++ b/gfs2/scripts/gfs2_wd_udev.sh -@@ -0,0 +1,30 @@ -+#!/bin/sh -+# -+# Do not run this script manually. This script is called by udev on a gfs2 -+# withdraw uevent and is used to complete the withdraw action and notify the -+# kernel. -+# -+ -+# Sanity checks -+if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] || -+ [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ] -+then -+ exit 1 # Nothing to do here -+fi -+ -+# Try and suspend the device -+SYSFS_TOPDIR="/sys"$DEVPATH -+DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name") -+DM_DEV="/dev/mapper/"$DM_NAME -+ -+if [ -z "$DM_DEV" ] -+then -+ /usr/bin/dmsetup suspend $DM_DEV -+fi -+ -+# Signal completion of withdraw -+WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw" -+if [ -f "$WD_ACK" ] -+then -+ echo "1" > $WD_ACK -+fi diff --git a/scripts_install_the_withdraw_helper_script.patch b/scripts_install_the_withdraw_helper_script.patch deleted file mode 100644 index de2d182..0000000 --- a/scripts_install_the_withdraw_helper_script.patch +++ /dev/null @@ -1,27 +0,0 @@ -commit fdded71f349ec5928a1422bc7edaa7f4f6c0be26 -Author: Andrew Price -Date: Tue Aug 18 12:48:50 2015 +0100 - - scripts: install the withdraw helper script - - Install gfs2_withdraw_helper into /usr/sbin in 'make install'. - - Signed-off-by: Andrew Price - -diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am -index 51764fa..056aaa5 100644 ---- a/gfs2/scripts/Makefile.am -+++ b/gfs2/scripts/Makefile.am -@@ -2,9 +2,9 @@ MAINTAINERCLEANFILES = Makefile.in - - dist_sbin_SCRIPTS = \ - gfs2_lockcapture \ -- gfs2_trace -+ gfs2_trace \ -+ gfs2_withdraw_helper - - noinst_SCRIPTS = \ -- 82-gfs2-withdraw.rules \ -- gfs2_withdraw_helper -+ 82-gfs2-withdraw.rules - diff --git a/scripts_install_the_withdraw_udev_rules_script.patch b/scripts_install_the_withdraw_udev_rules_script.patch deleted file mode 100644 index 430ea5e..0000000 --- a/scripts_install_the_withdraw_udev_rules_script.patch +++ /dev/null @@ -1,72 +0,0 @@ -commit 9aa261bd5e65beb757b0953ba43211fc29641952 -Author: Andrew Price -Date: Wed Aug 19 12:13:39 2015 +0100 - - scripts: install the withdraw udev rules script - - Add a --with-udevdir configure option and default to $prefix/lib/udev. - Note that we can't use $libdir for this as that will often be /usr/lib64 - and the udevdir is arch-independent. - - Also add the autoconf bits needed to install 82-gfs2-withdraw.rules into - $udevdir/rules.d - - Signed-off-by: Andrew Price - -diff --git a/README.build b/README.build -index acfde1b..d0a21c3 100644 ---- a/README.build -+++ b/README.build -@@ -31,10 +31,9 @@ To install gfs2-utils, run: - - The following scripts (located in gfs2/scripts) are used to complete - the userland portion of the gfs2 withdraw feature using uevents. They --are not installed by 'make install' and need to be installed manually --or during rpm installation to the corresponding locations. -+will be installed by 'make install' to these directories by default: - -- 82-gfs2-withdraw.rules in /etc/udev/rules.d/ -+ 82-gfs2-withdraw.rules in /usr/lib/udev/rules.d/ - gfs2_withdraw_helper in /usr/sbin/ - - See also doc/README.contributing for details on submitting patches and -diff --git a/configure.ac b/configure.ac -index de96e5a..35cafe6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -110,6 +110,12 @@ if test -z "$ncurses_CFLAGS" && test -z "$ncurses_LIBS"; then - ncurses_LIBS=-lncurses - fi - -+AC_ARG_WITH([udevdir], -+ AS_HELP_STRING([--with-udevdir=DIR], -+ [udev directory containing rules.d [default=${prefix}/lib/udev]]), -+ [], [with_udevdir=\${prefix}/lib/udev]) -+AC_SUBST([udevdir], [$with_udevdir]) -+ - # Checks for header files. - AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h mntent.h stddef.h sys/file.h sys/ioctl.h sys/mount.h sys/time.h sys/vfs.h syslog.h termios.h]) - AC_CHECK_HEADER([linux/fs.h], [], [AC_MSG_ERROR([Unable to find linux/fs.h])]) -@@ -209,7 +215,9 @@ echo " Configure summary" - echo " ===================" - echo " prefix : $prefix" - echo " exec_prefix : $exec_prefix" -+echo " libdir : $libdir" - echo " sbindir : $sbindir" -+echo " udevdir : $udevdir" - echo " ------------------" - echo " debug build : $enable_debug" - echo " C unit tests : $have_check" -diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am -index 056aaa5..d4bda04 100644 ---- a/gfs2/scripts/Makefile.am -+++ b/gfs2/scripts/Makefile.am -@@ -5,6 +5,6 @@ dist_sbin_SCRIPTS = \ - gfs2_trace \ - gfs2_withdraw_helper - --noinst_SCRIPTS = \ -+udevrulesdir=@udevdir@/rules.d -+dist_udevrules_DATA = \ - 82-gfs2-withdraw.rules -- diff --git a/scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch b/scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch deleted file mode 100644 index 7f48867..0000000 --- a/scripts_rename_gfs2_wd_udev_sh_to_gfs2_withdraw_helper.patch +++ /dev/null @@ -1,115 +0,0 @@ -commit bdb6bb67ee4532c2dfb65eeeebcec06bda99d4ff -Author: Andrew Price -Date: Tue Aug 18 12:35:52 2015 +0100 - - scripts: rename gfs2_wd_udev.sh to gfs2_withdraw_helper - - Makes the name more descriptive and consistent with the name of the udev - rules script. - - Signed-off-by: Andrew Price - -diff --git a/README.build b/README.build -index 6487bae..acfde1b 100644 ---- a/README.build -+++ b/README.build -@@ -35,7 +35,7 @@ are not installed by 'make install' and need to be installed manually - or during rpm installation to the corresponding locations. - - 82-gfs2-withdraw.rules in /etc/udev/rules.d/ -- gfs2_wd_udev.sh in /usr/sbin/ -+ gfs2_withdraw_helper in /usr/sbin/ - - See also doc/README.contributing for details on submitting patches and - doc/README.tests for more details regarding the test suite. -diff --git a/gfs2/scripts/82-gfs2-withdraw.rules b/gfs2/scripts/82-gfs2-withdraw.rules -index 2228615..2c9e0e8 100644 ---- a/gfs2/scripts/82-gfs2-withdraw.rules -+++ b/gfs2/scripts/82-gfs2-withdraw.rules -@@ -1,2 +1,2 @@ --SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_wd_udev.sh" -+SUBSYSTEM=="gfs2", ACTION=="offline", RUN+="/bin/sh /usr/sbin/gfs2_withdraw_helper" - -diff --git a/gfs2/scripts/Makefile.am b/gfs2/scripts/Makefile.am -index dde906f..51764fa 100644 ---- a/gfs2/scripts/Makefile.am -+++ b/gfs2/scripts/Makefile.am -@@ -6,5 +6,5 @@ dist_sbin_SCRIPTS = \ - - noinst_SCRIPTS = \ - 82-gfs2-withdraw.rules \ -- gfs2_wd_udev.sh -+ gfs2_withdraw_helper - -diff --git a/gfs2/scripts/gfs2_wd_udev.sh b/gfs2/scripts/gfs2_wd_udev.sh -deleted file mode 100755 -index ac3ce35..0000000 ---- a/gfs2/scripts/gfs2_wd_udev.sh -+++ /dev/null -@@ -1,30 +0,0 @@ --#!/bin/sh --# --# Do not run this script manually. This script is called by udev on a gfs2 --# withdraw uevent and is used to complete the withdraw action and notify the --# kernel. --# -- --# Sanity checks --if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] || -- [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ] --then -- exit 1 # Nothing to do here --fi -- --# Try and suspend the device --SYSFS_TOPDIR="/sys"$DEVPATH --DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name") --DM_DEV="/dev/mapper/"$DM_NAME -- --if [ -z "$DM_DEV" ] --then -- /usr/bin/dmsetup suspend $DM_DEV --fi -- --# Signal completion of withdraw --WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw" --if [ -f "$WD_ACK" ] --then -- echo "1" > $WD_ACK --fi -diff --git a/gfs2/scripts/gfs2_withdraw_helper b/gfs2/scripts/gfs2_withdraw_helper -new file mode 100755 -index 0000000..ac3ce35 ---- /dev/null -+++ b/gfs2/scripts/gfs2_withdraw_helper -@@ -0,0 +1,30 @@ -+#!/bin/sh -+# -+# Do not run this script manually. This script is called by udev on a gfs2 -+# withdraw uevent and is used to complete the withdraw action and notify the -+# kernel. -+# -+ -+# Sanity checks -+if [ "$SUBSYSTEM" != "gfs2" ] || [ "$LOCKPROTO" != "lock_dlm" ] || -+ [ -z "$DEVPATH" ] || [ "$ACTION" != "offline" ] -+then -+ exit 1 # Nothing to do here -+fi -+ -+# Try and suspend the device -+SYSFS_TOPDIR="/sys"$DEVPATH -+DM_NAME=$(cat "$SYSFS_TOPDIR/device/dm/name") -+DM_DEV="/dev/mapper/"$DM_NAME -+ -+if [ -z "$DM_DEV" ] -+then -+ /usr/bin/dmsetup suspend $DM_DEV -+fi -+ -+# Signal completion of withdraw -+WD_ACK="$SYSFS_TOPDIR/lock_module/withdraw" -+if [ -f "$WD_ACK" ] -+then -+ echo "1" > $WD_ACK -+fi diff --git a/sources b/sources index 0a3227f..119c866 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f43b26f006b0a58d86a08eed579871f1 gfs2-utils-3.1.8.tar.gz +6927ee519a26c05a3e03138f6f0462fa gfs2-utils-3.1.9.tar.gz