From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 2/3] gfs2_edit: Ensure all leaf blocks in per_node are saved
Date: Thu, 05 Jun 2014 10:39:59 +0100 [thread overview]
Message-ID: <53903AEF.9020605@redhat.com> (raw)
In-Reply-To: <1401931686-6697-2-git-send-email-anprice@redhat.com>
Hi,
On 05/06/14 02:28, Andrew Price wrote:
> block_is_in_per_node() only checks the first leaf block when the
> per_node directory has been split (when the block size is small and/or
> the number of journals is large). This caused savemeta to treat the
> files in per_node as user data and so didn't save their metadata. Add an
> outer loop to iterate over the indirect blocks.
Why does it matter whether the block in the per_node subdir or not? Are
we doing something special compared with other directories?
Steve.
> Signed-off-by: Andrew Price <anprice@redhat.com>
> ---
> gfs2/edit/savemeta.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
> index a43045f..360b144 100644
> --- a/gfs2/edit/savemeta.c
> +++ b/gfs2/edit/savemeta.c
> @@ -75,7 +75,7 @@ static int block_is_a_journal(void)
>
> static int block_is_in_per_node(void)
> {
> - int d;
> + int i;
> struct gfs2_inode *per_node_di;
>
> if (sbd.gfs1)
> @@ -90,9 +90,12 @@ static int block_is_in_per_node(void)
> do_dinode_extended(&per_node_di->i_di, per_node_di->i_bh);
> inode_put(&per_node_di);
>
> - for (d = 0; d < indirect->ii[0].dirents; d++) {
> - if (block == indirect->ii[0].dirent[d].block)
> - return TRUE;
> + for (i = 0; i < indirect_blocks; i++) {
> + int d;
> + for (d = 0; d < indirect->ii[i].dirents; d++) {
> + if (block == indirect->ii[i].dirent[d].block)
> + return TRUE;
> + }
> }
> return FALSE;
> }
next prev parent reply other threads:[~2014-06-05 9:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 1:28 [Cluster-devel] [PATCH 1/3] gfs2-utils: Fix two logic errors Andrew Price
2014-06-05 1:28 ` [Cluster-devel] [PATCH 2/3] gfs2_edit: Ensure all leaf blocks in per_node are saved Andrew Price
2014-06-05 9:39 ` Steven Whitehouse [this message]
2014-06-05 10:39 ` Andrew Price
2014-06-05 1:28 ` [Cluster-devel] [PATCH 3/3] gfs2-utils tests: Add small-block savemeta tests Andrew Price
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=53903AEF.9020605@redhat.com \
--to=swhiteho@redhat.com \
/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.