cluster: STABLE32 - build: ship checkquorum.wdmd non executable
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=9c10e5bbd91...
Commit: 9c10e5bbd912488fb694e8fd81f1e745d99f2acc
Parent: 544a70cbcf94410d277fd7123a1943c8d2bef790
Author: Radek Steiger <rsteiger(a)redhat.com>
AuthorDate: Mon Jan 7 18:44:30 2013 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jan 7 18:44:30 2013 +0100
build: ship checkquorum.wdmd non executable
this avoids some selinux/rgmanager integration issues
Resolves: rhbz#509056
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/scripts/Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/cman/scripts/Makefile b/cman/scripts/Makefile
index 7950311..f80f7e4 100644
--- a/cman/scripts/Makefile
+++ b/cman/scripts/Makefile
@@ -1,4 +1,5 @@
-SHAREDIRTEX=checkquorum checkquorum.wdmd
+SHAREDIRTEX=checkquorum
+SHAREDIRT=checkquorum.wdmd
include ../../make/defines.mk
include $(OBJDIR)/make/clean.mk
11 years, 3 months
gfs2-utils: master - gfs2_lockcapture: The script now returns a correct exit code when the script exits.
by shane bradley
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=dc8cfec2...
Commit: dc8cfec21502d89e2c1283d1bb72c4d14f58f6c9
Parent: efd9859b14143d5c124bba686a6bc19983d29e42
Author: Shane Bradley <sbradley(a)redhat.com>
AuthorDate: Thu Dec 20 10:31:00 2012 -0500
Committer: Shane Bradley <sbradley(a)redhat.com>
CommitterDate: Fri Jan 4 08:47:02 2013 -0500
gfs2_lockcapture: The script now returns a correct exit code when the script exits.
If there was files(not directories) created then the script will exit with 0,
else 1 since there was no lockdump files captured on any run of capturing the
data. Updated examples in man page. Change the default output path so that the
node name is not in the path. In addition I change how the clusternode name is
parsed.
Signed-off-by: Shane Bradley <sbradley(a)redhat.com>
---
gfs2/scripts/gfs2_lockcapture | 49 ++++++++++++++++++++++++++--------------
1 files changed, 32 insertions(+), 17 deletions(-)
diff --git a/gfs2/scripts/gfs2_lockcapture b/gfs2/scripts/gfs2_lockcapture
index 1a64188..2b3421c 100644
--- a/gfs2/scripts/gfs2_lockcapture
+++ b/gfs2/scripts/gfs2_lockcapture
@@ -33,7 +33,7 @@ import tarfile
sure only 1 instance of this script is running at any time.
@type PATH_TO_PID_FILENAME: String
"""
-VERSION_NUMBER = "0.9-2"
+VERSION_NUMBER = "0.9-3"
MAIN_LOGGER_NAME = "%s" %(os.path.basename(sys.argv[0]))
PATH_TO_DEBUG_DIR="/sys/kernel/debug"
PATH_TO_PID_FILENAME = "/var/run/%s.pid" %(os.path.basename(sys.argv[0]))
@@ -570,11 +570,10 @@ def getClusterNode(listOfGFS2Names):
stdout = runCommandOutput("corosync-quorumtool", ["-l"])
if (not stdout == None):
for line in stdout.split("\n"):
- splitLine = line.split()
- if (len(splitLine) == 4):
- if (splitLine[0].strip().rstrip() == thisNodeID):
- clusternodeName = splitLine[3]
- break;
+ if (line.find("local") >=0):
+ splitLine = line.split(" (local)")
+ clusternodeName = splitLine[0].split()[2]
+ break;
# If a clusternode name and cluster name was found then return a new object
# since this means this cluster is part of cluster.
if ((len(clusterName) > 0) and (len(clusternodeName) > 0)):
@@ -815,6 +814,10 @@ def gatherGFS2LockDumps(pathToDSTDir, listOfGFS2Filesystems):
and filesystem name for each item in the list. For example:
"f18cluster:mygfs2vol1"
+ @return: Returns True if files(not directories) were copied to the
+ destination directory.
+ @rtype: Boolean
+
@param pathToDSTDir: This is the path to directory where the files will be
copied to.
@type pathToDSTDir: String
@@ -825,13 +828,19 @@ def gatherGFS2LockDumps(pathToDSTDir, listOfGFS2Filesystems):
lockDumpType = "gfs2"
pathToSrcDir = os.path.join(PATH_TO_DEBUG_DIR, lockDumpType)
pathToOutputDir = os.path.join(pathToDSTDir, lockDumpType)
+ # The number of files that were copied
+ fileCopiedCount = 0
for dirName in os.listdir(pathToSrcDir):
pathToCurrentDir = os.path.join(pathToSrcDir, dirName)
if ((os.path.isdir(pathToCurrentDir)) and (dirName in listOfGFS2Filesystems)):
message = "Copying the lockdump data for the %s filesystem: %s" %(lockDumpType.upper(), dirName)
logging.getLogger(MAIN_LOGGER_NAME).debug(message)
- copyDirectory(pathToCurrentDir, pathToOutputDir)
-
+ copySuccessful = copyDirectory(pathToCurrentDir, pathToOutputDir)
+ if (copySuccessful and os.path.exists(os.path.join(pathToOutputDir, dirName))):
+ fileCopiedCount = len(os.listdir(os.path.join(pathToOutputDir, dirName)))
+ # If the number of files(not directories) copied was greater than zero then files were copied
+ # succesfully.
+ return (fileCopiedCount > 0)
# ##############################################################################
# Get user selected options
# ##############################################################################
@@ -936,18 +945,18 @@ class OptionParserExtended(OptionParser):
self.print_version()
examplesMessage = "\n"
examplesMessage = "\nPrints information about the available GFS2 filesystems that can have lockdump data captured."
- examplesMessage += "\n$ %s -i\n" %(self.__commandName)
+ examplesMessage += "\n# %s -i\n" %(self.__commandName)
examplesMessage += "\nIt will do 3 runs of gathering the lockdump information in 10 second intervals for only the"
examplesMessage += "\nGFS2 filesystems with the names myGFS2vol2,myGFS2vol1. Then it will archive and compress"
examplesMessage += "\nthe data collected. All of the lockdump data will be written to the directory: "
examplesMessage += "\n/tmp/2012-11-12_095556-gfs2_lockcapture and all the questions will be answered with yes.\n"
- examplesMessage += "\n$ %s -r 3 -s 10 -t -n myGFS2vol2,myGFS2vol1 -o /tmp/2012-11-12_095556-gfs2_lockcapture -y\n" %(self.__commandName)
+ examplesMessage += "\n# %s -r 3 -s 10 -t -n myGFS2vol2,myGFS2vol1 -o /tmp/2012-11-12_095556-gfs2_lockcapture -y\n" %(self.__commandName)
examplesMessage += "\nIt will do 2 runs of gathering the lockdump information in 25 second intervals for all the"
examplesMessage += "\nmounted GFS2 filesystems. Then it will archive and compress the data collected. All of the"
examplesMessage += "\nlockdump data will be written to the directory: /tmp/2012-11-12_095556-gfs2_lockcapture.\n"
- examplesMessage += "\n$ %s -r 2 -s 25 -t -o /tmp/2012-11-12_095556-gfs2_lockcapture\n" %(self.__commandName)
+ examplesMessage += "\n# %s -r 2 -s 25 -t -o /tmp/2012-11-12_095556-gfs2_lockcapture\n" %(self.__commandName)
OptionParser.print_help(self)
print examplesMessage
@@ -1001,7 +1010,8 @@ class ExtendOption (Option):
# ###############################################################################
if __name__ == "__main__":
"""
- When the script is executed then this code is ran.
+ When the script is executed then this code is ran. If there was files(not
+ directories) created then 0 will be returned, else a 1 is returned.
"""
try:
# #######################################################################
@@ -1106,7 +1116,7 @@ if __name__ == "__main__":
# #######################################################################
pathToOutputDir = cmdLineOpts.pathToOutputDir
if (not len(pathToOutputDir) > 0):
- pathToOutputDir = "%s" %(os.path.join("/tmp", "%s-%s-%s" %(time.strftime("%Y-%m-%d_%H%M%S"), clusternode.getClusterNodeName(), os.path.basename(sys.argv[0]))))
+ pathToOutputDir = "%s" %(os.path.join("/tmp", "%s-%s" %(time.strftime("%Y-%m-%d_%H%M%S"), os.path.basename(sys.argv[0]))))
# #######################################################################
# Backup any existing directory with same name as current output
# directory.
@@ -1139,8 +1149,12 @@ if __name__ == "__main__":
# Gather data and the lockdumps.
# #######################################################################
if (cmdLineOpts.numberOfRuns <= 0):
- message = "The number of runs should be greater than zero."
+ message = "The number of runs must be greater than zero."
+ logging.getLogger(MAIN_LOGGER_NAME).warning(message)
exitScript(errorCode=1)
+ # If GFS2 lockdump files were successfully copied to output directory
+ # then the exit code will be set to 0, else the exit code will be 1.
+ exitCode = 1
for i in range(1,(cmdLineOpts.numberOfRuns + 1)):
# The current log count that will start at 1 and not zero to make it
# make sense in logs.
@@ -1189,14 +1203,15 @@ if __name__ == "__main__":
lockDumpType = "gfs2"
message = "Pass (%d/%d): Gathering the %s lock dumps for the host." %(i, cmdLineOpts.numberOfRuns, lockDumpType.upper())
logging.getLogger(MAIN_LOGGER_NAME).debug(message)
- gatherGFS2LockDumps(pathToOutputRunDir, clusternode.getMountedGFS2FilesystemNames())
+ if(gatherGFS2LockDumps(pathToOutputRunDir, clusternode.getMountedGFS2FilesystemNames())):
+ exitCode = 0
# Gather log files
message = "Pass (%d/%d): Gathering the log files for the host." %(i, cmdLineOpts.numberOfRuns)
logging.getLogger(MAIN_LOGGER_NAME).debug(message)
gatherLogs(os.path.join(pathToOutputRunDir, "logs"))
# Sleep between each run if secondsToSleep is greater than or equal
# to 0 and current run is not the last run.
- if ((cmdLineOpts.secondsToSleep >= 0) and (i <= (cmdLineOpts.numberOfRuns))):
+ if ((cmdLineOpts.secondsToSleep >= 0) and (i < (cmdLineOpts.numberOfRuns))):
message = "The script will sleep for %d seconds between each run of capturing the lockdump data." %(cmdLineOpts.secondsToSleep)
logging.getLogger(MAIN_LOGGER_NAME).info(message)
time.sleep(cmdLineOpts.secondsToSleep)
@@ -1228,4 +1243,4 @@ if __name__ == "__main__":
# #######################################################################
# Exit the application with zero exit code since we cleanly exited.
# #######################################################################
- exitScript()
+ exitScript(errorCode=exitCode)
11 years, 3 months
cluster: RHEL6 - fsck.gfs2: Detect and fix mismatch in GFS1 formal inode number
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=77be7299969...
Commit: 77be7299969e63c4874d11aeb692c0a03efa6d5d
Parent: 3bb261e473a972f0b183be3870794c6e4df8f97d
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Dec 19 09:09:27 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:35:14 2013 -0700
fsck.gfs2: Detect and fix mismatch in GFS1 formal inode number
This patch adds code to fsck.gfs2 that checks and fixes
GFS1 formal inode numbers. In GFS1 only, the formal inode number
is supposed to match the block address. If it doesn't, it's a
problem that should be fixed. If the problem goes undetected,
further conversions to GFS2 via the gfs2_convert tool will treat
the dinode as not being GFS1, which, in turn, yields the wrong
type number in the dirent. This causes the file in question to
be improperly treated (by gfs2_convert) as a GFS2 fifo
(DT_FIFO==1) rather than a GFS1 file (GFS_FILE_REG==1). The end
result is something like this, from pass2 in fsck.gfs2, after
the gfs2_convert:
Type 'fifo' in dir entry (lost_file_20431, 20431/0x4fcf)
conflicts with type 'file' in dinode. (Dir entry is stale.)
rhbz#888053
---
gfs2/fsck/pass1.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index d1209e6..9a2398a 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1309,6 +1309,23 @@ static int handle_di(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh)
log_err( _("Address in inode at block #%" PRIu64
" (0x%" PRIx64 ") not fixed\n"), block, block);
}
+ if (sdp->gfs1 && ip->i_di.di_num.no_formal_ino != block) {
+ log_err( _("Inode #%llu (0x%llx): GFS1 formal inode number "
+ "mismatch: was %llu (0x%llx)\n"),
+ (unsigned long long)block, (unsigned long long)block,
+ (unsigned long long)ip->i_di.di_num.no_formal_ino,
+ (unsigned long long)ip->i_di.di_num.no_formal_ino);
+ if (query( _("Fix formal inode number in inode #%llu"
+ " (0x%llx)? (y/n) "), (unsigned long long)block,
+ (unsigned long long)block)) {
+ ip->i_di.di_num.no_formal_ino = block;
+ bmodified(ip->i_bh);
+ } else
+ log_err( _("Inode number in inode at block #%lld "
+ "(0x%llx) not fixed\n"),
+ (unsigned long long)block,
+ (unsigned long long)block);
+ }
error = handle_ip(sdp, ip);
fsck_inode_put(&ip);
return error;
11 years, 3 months
cluster: RHEL6 - gfs2_convert: mask out proper bits when identifying symlinks
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=3bb261e473a...
Commit: 3bb261e473a972f0b183be3870794c6e4df8f97d
Parent: 9f3aa3018314f9d1a93024bc554fdf020256caaa
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Wed Dec 19 07:47:15 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:35:04 2013 -0700
gfs2_convert: mask out proper bits when identifying symlinks
This patch masks out the proper file type bit in order to
distinguish files from symlinks. Include stat.h defines:
So the check for "di_mode & S_IFLNK" will match regular files,
not just symlinks. The problem was that gfs2_convert was matching
regular files and treating them as symlinks, which destroyed
the di_blocks field in the dinode. The patch also has some minor
cleanups.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 6f3dfb3..9594908 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -816,7 +816,6 @@ static int has_cdpn(const char *str)
static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct gfs2_inode *ip)
{
- int ret = 0;
char *linkptr = NULL;
if (ip->i_di.di_height != 0)
@@ -837,7 +836,7 @@ static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, s
(osi_list_t *)&cdpns_to_fix);
}
- return ret;
+ return 0;
}
/*
@@ -852,7 +851,7 @@ static int fix_cdpn_symlink(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, s
*/
static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct gfs2_inode *ip)
{
- int ret = 0, len, old_hdr_sz, new_hdr_sz;
+ int len, old_hdr_sz, new_hdr_sz;
struct gfs2_buffer_head *eabh;
char *buf;
@@ -875,7 +874,7 @@ static int fix_xattr(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh, struct g
}
brelse(eabh);
- return ret;
+ return 0;
}
/* ------------------------------------------------------------------------- */
@@ -894,8 +893,8 @@ static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh)
inode_was_gfs1 = (inode->i_di.di_num.no_formal_ino ==
inode->i_di.di_num.no_addr);
/* Fix the inode number: */
- inode->i_di.di_num.no_formal_ino = sbp->md.next_inum; ;
-
+ inode->i_di.di_num.no_formal_ino = sbp->md.next_inum;
+
/* Fix the inode type: gfs1 uses di_type, gfs2 uses di_mode. */
inode->i_di.di_mode &= ~S_IFMT;
switch (inode->i_di.__pad1) { /* formerly di_type */
@@ -961,7 +960,7 @@ static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh)
if (adjust_indirect_blocks(sbp, inode))
return -1;
/* Check for cdpns */
- if (inode->i_di.di_mode & S_IFLNK) {
+ if (S_ISLNK(inode->i_di.di_mode)) {
ret = fix_cdpn_symlink(sbp, bh, inode);
if (ret)
return -1;
11 years, 3 months
cluster: RHEL6 - gfs2_convert: clear out old di_mode before setting it
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=9f3aa301831...
Commit: 9f3aa3018314f9d1a93024bc554fdf020256caaa
Parent: f6f7fc44566dc95c983a24b5b51d5b0d4f36f2e9
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Tue Dec 18 14:14:08 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:35:01 2013 -0700
gfs2_convert: clear out old di_mode before setting it
This patch clears the dinode 'di_mode' inode type field before
setting it based on the GFS1 value. In rare circumstances
(e.g. fsck.gfs2 ran on a GFS1 file system and created lost+found
with both GFS1 and GFS2 data) di_mode might have an old value.
In these cases, simply doing a logical 'or' with the correct
value produces an invalid value. Zeroing it out beforehand ensures
it is set correctly based on the GFS1 type.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index d6fe1c8..6f3dfb3 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -897,6 +897,7 @@ static int adjust_inode(struct gfs2_sbd *sbp, struct gfs2_buffer_head *bh)
inode->i_di.di_num.no_formal_ino = sbp->md.next_inum; ;
/* Fix the inode type: gfs1 uses di_type, gfs2 uses di_mode. */
+ inode->i_di.di_mode &= ~S_IFMT;
switch (inode->i_di.__pad1) { /* formerly di_type */
case GFS_FILE_DIR: /* directory */
inode->i_di.di_mode |= S_IFDIR;
11 years, 3 months
cluster: RHEL6 - gfs2_convert: calculate height 1 for small files that were once big
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=f6f7fc44566...
Commit: f6f7fc44566dc95c983a24b5b51d5b0d4f36f2e9
Parent: 2dd28337827ec1da6e2818ad293e2f04871aac31
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 15:11:34 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:34:54 2013 -0700
gfs2_convert: calculate height 1 for small files that were once big
This patch changes function calc_gfs2_tree_height so that it gives
a height of 1 to small files that once were big. The problems here
is with files that were once big (needed two levels of indirection
(height 2)) and then are truncated to a tiny non-zero size
(ordinarily, they would be stuffed, but due to the growth followed
by truncate, they're still at height 2). The required GFS2 height is
zero, whereas the GFS1 height is 2. After the conversion the file
will not really be stuffed, because function fix_metatree will
unstuff the dinode as part of its conversion. So at least it will
be at height 1. The problem is that if we don't fix the 0 height to
its proper value of 1, fix_ind_reg_or_dir gets called with gfs2_hgt=0,
which then calls mp_gfs1_to_gfs2, which then tries to set:
gfs2factor[gfs2_h - 1] = 1ull. This results in a negative index of the
array.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 7610c6b..d6fe1c8 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -258,6 +258,12 @@ static unsigned int calc_gfs2_tree_height(struct gfs2_inode *ip, uint64_t size)
for (height = 0; height < max; height++)
if (arr[height] >= size)
break;
+ /* If calc_gfs2_tree_height was called, the dinode is not stuffed or
+ we would have returned before this point. After the call, a call is
+ made to fix_metatree, which unstuffs the dinode. Therefore, the
+ smallest height that can result after this call is 1. */
+ if (!height)
+ height = 1;
return height;
}
11 years, 3 months
cluster: RHEL6 - gfs2_convert: Use proper header size when reordering meta pointers
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=2dd28337827...
Commit: 2dd28337827ec1da6e2818ad293e2f04871aac31
Parent: eb32171e9353f4da43d0ed46a077bc8419a09b02
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 15:01:02 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:34:41 2013 -0700
gfs2_convert: Use proper header size when reordering meta pointers
This patch changes function fix_metatree to use a proper metadata
header size. Before, it was using sizeof(struct gfs2_meta_header).
That's correct in almost all cases. But if you make a big file,
such that it goes into height==2 (two levels of indirection), then
truncate the file back to where it only would normally only need
height==1, then run gfs2_convert, it gets into trouble. That's
because you have a small file size, which calculates a much smaller
number of GFS2 pointers needed, due to the truncation. Function
fix_metatree will ensure at least one level of indirection by
unstuffing the converted dinode, but we need to start pushing out
the pointers onto the dinode's buffer, and for that, we need to
calculate the right header size.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 8427326..7610c6b 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -342,7 +342,8 @@ static void fix_metatree(struct gfs2_sbd *sbp, struct gfs2_inode *ip,
gfs2_meta_header_out(&mh, bh);
}
- hdrsize = sizeof(struct gfs2_meta_header);
+ hdrsize = blk->height ? sizeof(struct gfs2_meta_header) :
+ sizeof(struct gfs2_dinode);
if (amount > sbp->bsize - hdrsize - ptramt)
amount = sbp->bsize - hdrsize - ptramt;
11 years, 3 months
cluster: RHEL6 - gfs2_convert: remember number of blocks when converting quotas
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=eb32171e935...
Commit: eb32171e9353f4da43d0ed46a077bc8419a09b02
Parent: b75e3df94696cdc41a52e4c2ccd7dfd44c9a9d52
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 14:56:16 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:34:33 2013 -0700
gfs2_convert: remember number of blocks when converting quotas
This patch changes function copy_quotas so that it properly copies
the di_blocks field from the GFS1 quotas file to its new GFS2 file.
If the quota file had a non-trivial size, gfs2_convert was copying
all the data and pointers, but not properly setting the di_blocks.
This ordinarily isn't tragic because the file is never deleted, but
it did flag fsck.gfs2 errors.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index ee41117..8427326 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -2033,6 +2033,7 @@ static void copy_quotas(struct gfs2_sbd *sdp)
nq_ip->i_di.di_height = oq_ip->i_di.di_height;
nq_ip->i_di.di_size = oq_ip->i_di.di_size;
+ nq_ip->i_di.di_blocks = oq_ip->i_di.di_blocks;
memcpy(nq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
oq_ip->i_bh->b_data + sizeof(struct gfs2_dinode),
sdp->bsize - sizeof(struct gfs2_dinode));
11 years, 3 months
cluster: RHEL6 - gfs2_convert: mark buffer dirty when switching dirs from meta to data
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=b75e3df9469...
Commit: b75e3df94696cdc41a52e4c2ccd7dfd44c9a9d52
Parent: 129b016470e49e7fdd40a6116285c976c88307b3
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 14:47:50 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:34:24 2013 -0700
gfs2_convert: mark buffer dirty when switching dirs from meta to data
This patch changes function inode_renumber so that it properly marks
the rgrp bitmap dirty after switching bits from "meta" to "data".
This happens when directory leaf, hash table, eattr, etc. blocks come
in from GFS1 as "meta" and need to be switched to GFS2 as "data".
In GFS2, only dinodes get the "meta" designation. This conversion was
taking place, but the code broke out of the loop before properly
marking the buffer as modified. So if no other modifications were
done to that bitmap, the bitmap change would be forgotten.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index 2a72504..ee41117 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -1051,10 +1051,10 @@ static int inode_renumber(struct gfs2_sbd *sbp, uint64_t root_inode_addr, osi_li
~(0x03 << (GFS2_BIT_SIZE * byte_bit));
rgd->bh[blk]->b_data[buf_offset + bitmap_byte] |=
(0x01 << (GFS2_BIT_SIZE * byte_bit));
+ bmodified(rgd->bh[blk]);
break;
}
bitmap_byte -= (sbp->bsize - buf_offset);
- bmodified(rgd->bh[blk]);
}
}
brelse(bh);
11 years, 3 months
cluster: RHEL6 - gfs2_convert: mark rgrp bitmaps dirty when converting
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=129b016470e...
Commit: 129b016470e49e7fdd40a6116285c976c88307b3
Parent: 7f67d0a871e5bbafcd98ceb381deb2539f4b0e93
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Mon Dec 17 14:43:04 2012 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jan 3 07:33:45 2013 -0700
gfs2_convert: mark rgrp bitmaps dirty when converting
This patch changes gfs2_convert function convert_bitmaps so that
it marks the affected rgrp buffers as modified when bitmap bits
are switched from unlinked metadata to free blocks.
rhbz#888053
---
gfs2/convert/gfs2_convert.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gfs2/convert/gfs2_convert.c b/gfs2/convert/gfs2_convert.c
index fa6461f..2a72504 100644
--- a/gfs2/convert/gfs2_convert.c
+++ b/gfs2/convert/gfs2_convert.c
@@ -184,8 +184,10 @@ static void convert_bitmaps(struct gfs2_sbd *sdp, struct rgrp_tree *rg)
for (y = 0; y < GFS2_NBBY; y++) {
state = (rg->bh[blk]->b_data[x] >>
(GFS2_BIT_SIZE * y)) & 0x03;
- if (state == 0x02) /* unallocated metadata state invalid */
+ if (state == 0x02) {/* unallocated metadata state invalid */
rg->bh[blk]->b_data[x] &= ~(0x02 << (GFS2_BIT_SIZE * y));
+ bmodified(rg->bh[blk]);
+ }
}
}
}/* convert_bitmaps */
11 years, 3 months