linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Azat Khuzhin <a3at.mail@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: darrick.wong@oracle.com, adilger@dilger.ca, tytso@mit.edu,
	Azat Khuzhin <a3at.mail@gmail.com>
Subject: [PATCH 3/5] tune2fs: remove_journal_device(): use the correct block to find jsb
Date: Thu, 10 Jul 2014 18:35:06 +0400	[thread overview]
Message-ID: <1405002908-16332-4-git-send-email-a3at.mail@gmail.com> (raw)
In-Reply-To: <1405002908-16332-1-git-send-email-a3at.mail@gmail.com>

Signed-off-by: Azat Khuzhin <a3at.mail@gmail.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
---
 misc/tune2fs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 9d21623..b395c7c 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -193,6 +193,7 @@ static int remove_journal_device(ext2_filsys fs)
 	errcode_t	retval;
 	int		commit_remove_journal = 0;
 	io_manager	io_ptr;
+	int start;
 
 	if (f_flag)
 		commit_remove_journal = 1; /* force removal even if error */
@@ -229,8 +230,10 @@ static int remove_journal_device(ext2_filsys fs)
 		goto no_valid_journal;
 	}
 
+	start = ext2fs_journal_sb_start(fs->blocksize);
 	/* Get the journal superblock */
-	if ((retval = io_channel_read_blk64(jfs->io, 1, -EXT2_SUPERBLOCK_SIZE, buf))) {
+	if ((retval = io_channel_read_blk64(jfs->io, start,
+	    -EXT2_SUPERBLOCK_SIZE, buf))) {
 		com_err(program_name, retval, "%s",
 			_("while reading journal superblock"));
 		goto no_valid_journal;
@@ -261,7 +264,8 @@ static int remove_journal_device(ext2_filsys fs)
 	jsb->s_nr_users = htonl(nr_users);
 
 	/* Write back the journal superblock */
-	if ((retval = io_channel_write_blk64(jfs->io, 1, -EXT2_SUPERBLOCK_SIZE, buf))) {
+	if ((retval = io_channel_write_blk64(jfs->io, start,
+	    -EXT2_SUPERBLOCK_SIZE, buf))) {
 		com_err(program_name, retval,
 			"while writing journal superblock.");
 		goto no_valid_journal;
-- 
2.0.0


  parent reply	other threads:[~2014-07-10 14:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 14:35 [PATCH 0/5] e2fsprogs: some small cleanups and fixes for journal code Azat Khuzhin
2014-07-10 14:35 ` [PATCH 1/5] lib: add EXT2_ prefix for SUPERBLOCK_{OFFSET,SIZE} Azat Khuzhin
2014-07-10 14:35 ` [PATCH 2/5] journal: use consts instead of 1024 and add helper for journal with 1k blocksize Azat Khuzhin
2014-07-10 14:35 ` Azat Khuzhin [this message]
2014-07-10 14:35 ` [PATCH 4/5] tune2fs: update journal super block when changing UUID for fs Azat Khuzhin
2014-07-10 14:35 ` [PATCH 5/5] tune2fs: update journal users while updating fs UUID (with external journal) Azat Khuzhin
2014-07-26  7:33 ` [PATCH 0/5] e2fsprogs: some small cleanups and fixes for journal code Azat Khuzhin
2014-07-26 14:31   ` Theodore Ts'o
2014-07-28  8:06     ` Azat Khuzhin
2014-07-28 13:00       ` Theodore Ts'o
2014-07-28 13:53         ` Azat Khuzhin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405002908-16332-4-git-send-email-a3at.mail@gmail.com \
    --to=a3at.mail@gmail.com \
    --cc=adilger@dilger.ca \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).