From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] GFS2: kernel changes to support new gfs2_grow command (Try 3)
Date: Fri, 4 May 2007 14:37:14 -0500 [thread overview]
Message-ID: <20070504193714.GB13775@redhat.com> (raw)
In-Reply-To: <46394174.2030709@redhat.com>
On Wed, May 02, 2007 at 08:57:08PM -0500, Robert Peterson wrote:
> * gfs2_ri_update - Pull in a new resource index from the disk
> * @gl: The glock covering the rindex inode
> *
> @@ -447,7 +479,12 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
> u64 junk = ip->i_di.di_size;
> int error;
>
> - if (do_div(junk, sizeof(struct gfs2_rindex))) {
> + /* If someone is holding the rindex file with a glock, they must
> + be updating it, in which case we may have partial entries.
> + In this case, we ignore the partials. */
> + if (!gfs2_glock_is_held_excl(ip->i_gl) &&
> + !gfs2_glock_is_held_shrd(ip->i_gl) &&
> + do_div(junk, sizeof(struct gfs2_rindex))) {
> gfs2_consist_inode(ip);
> return -EIO;
> }
So the use of glock_is_held _is_ part of an assertion, not part of an
algorithm which I was worried about before. We should only ever get to
this spot with a shared glock, right? (rindex_hold takes it). So a plain
old assertion that the glock is shared at the beginning would be ok, but
this particular check doesn't make sense to me.
> @@ -457,6 +494,9 @@ static int gfs2_ri_update(struct gfs2_inode *ip)
> file_ra_state_init(&ra_state, inode->i_mapping);
> for (sdp->sd_rgrps = 0;; sdp->sd_rgrps++) {
> loff_t pos = sdp->sd_rgrps * sizeof(struct gfs2_rindex);
> +
> + if (pos + sizeof(struct gfs2_rindex) >= ip->i_di.di_size)
> + break;
Why is this needed now if it wasn't before?
> error = gfs2_internal_read(ip, &ra_state, buf, &pos,
> sizeof(struct gfs2_rindex));
> if (!error)
Dave
next prev parent reply other threads:[~2007-05-04 19:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 1:57 [Cluster-devel] [PATCH] GFS2: kernel changes to support new gfs2_grow command (Try 3) Robert Peterson
2007-05-04 16:47 ` David Teigland
2007-05-04 21:35 ` Robert Peterson
2007-05-04 22:16 ` David Teigland
2007-05-04 19:37 ` David Teigland [this message]
2007-05-04 21:37 ` Robert Peterson
2007-05-08 14:56 ` Robert Peterson
2007-05-04 20:23 ` David Teigland
2007-05-04 21:48 ` Robert Peterson
2007-05-04 22:04 ` David Teigland
2007-05-08 14:17 ` Robert Peterson
2007-05-08 14:24 ` Steven Whitehouse
-- strict thread matches above, loose matches on Subject: below --
2007-05-08 20:42 David Teigland
2007-05-08 20:43 David Teigland
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=20070504193714.GB13775@redhat.com \
--to=teigland@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.