All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: [PATCH] libext2: advance group in ext2fs_open2 during swapping
Date: Tue, 08 Nov 2011 16:26:35 -0600	[thread overview]
Message-ID: <4EB9AC9B.5020803@redhat.com> (raw)

Without this change, we go back to getting group descriptor
"0" each time we go around the "for i" loop.  It must properly
advance through the filesystem.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

(I couldn't decipher the removed comment; maybe it was typed when
you thought you would do:

                        gdp = ext2fs_group_desc(fs, dest, j);

which would also work ... ?  It'd be clever, but I think my change
is more explicitly obvious.  Either way works.

We still have failing tests but at least nothing hangs now:
Tests failed: f_mmp f_mmp_garbage m_mmp t_mmp_1on t_mmp_2off 


diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 0cefe3f..40a52c5 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -356,8 +356,8 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
 			goto cleanup;
 #ifdef WORDS_BIGENDIAN
 		for (j=0; j < groups_per_block; j++) {
-			/* The below happens to work... be careful. */
-			gdp = ext2fs_group_desc(fs, fs->group_desc, j);
+			gdp = ext2fs_group_desc(fs, fs->group_desc,
+						i * groups_per_block + j);
 			ext2fs_swap_group_desc2(fs, gdp);
 		}
 #endif


             reply	other threads:[~2011-11-08 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08 22:26 Eric Sandeen [this message]
2011-11-10 12:02 ` [PATCH] libext2: advance group in ext2fs_open2 during swapping Ted Ts'o

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=4EB9AC9B.5020803@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.