* [Cluster-devel] [PATCH 1 of 5]Bz #248176: GFS2: invalid metadata block, gfs2_meta_indirect_buffer
@ 2007-07-24 5:12 Bob Peterson
0 siblings, 0 replies; 4+ messages in thread
From: Bob Peterson @ 2007-07-24 5:12 UTC (permalink / raw)
To: cluster-devel.redhat.com
This is the first of five patches for bug #248176:
There were still some critical variables being manipulated outside
the log_lock spinlock. That usually resulted in more hangs.
--
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--- lops.c 2007-07-12 16:54:06.000000000 -0500
+++ /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/fs/gfs2/lops.c 2007-07-23 10:11:18.000000000 -0500
@@ -117,7 +117,7 @@ static void buf_lo_before_commit(struct
struct buffer_head *bh;
struct gfs2_log_descriptor *ld;
struct gfs2_bufdata *bd1 = NULL, *bd2;
- unsigned int total = sdp->sd_log_num_buf;
+ unsigned int total;
unsigned int offset = BUF_OFFSET;
unsigned int limit;
unsigned int num;
@@ -127,12 +127,16 @@ static void buf_lo_before_commit(struct
limit = buf_limit(sdp);
/* for 4k blocks, limit = 503 */
+ gfs2_log_lock(sdp);
+ total = sdp->sd_log_num_buf;
bd1 = bd2 = list_prepare_entry(bd1, &sdp->sd_log_le_buf,
bd_le.le_list);
while(total) {
num = total;
if (total > limit)
num = limit;
+ gfs2_log_unlock(sdp);
bh = gfs2_log_get_buf(sdp);
+ gfs2_log_lock(sdp);
ld = (struct gfs2_log_descriptor *)bh->b_data;
ptr = (__be64 *)(bh->b_data + offset);
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
@@ -152,21 +156,27 @@ static void buf_lo_before_commit(struct
break;
}
+ gfs2_log_unlock(sdp);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
+ gfs2_log_lock(sdp);
n = 0;
list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
bd_le.le_list) {
+ gfs2_log_unlock(sdp);
bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
+ gfs2_log_lock(sdp);
if (++n >= num)
break;
}
+ BUG_ON(total < num);
total -= num;
}
+ gfs2_log_unlock(sdp);
}
static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail
*ai)
@@ -524,7 +534,7 @@ static void databuf_lo_before_commit(str
struct gfs2_log_descriptor *ld;
unsigned int limit;
unsigned int total_dbuf;
- unsigned int total_jdata = sdp->sd_log_num_jdata;
+ unsigned int total_jdata;
unsigned int num, n;
__be64 *ptr = NULL;
@@ -536,6 +546,7 @@ static void databuf_lo_before_commit(str
*/
gfs2_log_lock(sdp);
total_dbuf = sdp->sd_log_num_databuf;
+ total_jdata = sdp->sd_log_num_jdata;
bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
bd_le.le_list);
while(total_dbuf) {
@@ -621,10 +632,11 @@ static void databuf_lo_before_commit(str
}
gfs2_log_unlock(sdp);
if (bh) {
- set_buffer_mapped(bh);
+ BUG_ON(!buffer_mapped(bh));
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
bh = NULL;
+ ptr = NULL;
}
n = 0;
gfs2_log_lock(sdp);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1 of 5]Bz #248176: GFS2: invalid metadata block, gfs2_meta_indirect_buffer
@ 2007-07-24 14:06 Bob Peterson
2007-07-24 14:11 ` Steven Whitehouse
0 siblings, 1 reply; 4+ messages in thread
From: Bob Peterson @ 2007-07-24 14:06 UTC (permalink / raw)
To: cluster-devel.redhat.com
This is a resend of patch 1 with the following changes:
1. Word wrap is off (I think patch 1 was the only one that word wrapped)
2. The debug code was removed.
Bob Peterson
--
This is the first of five patches for bug #248176:
There were still some critical variables being manipulated outside
the log_lock spinlock. That usually resulted in more hangs.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
--
--- lops.c 2007-07-12 16:54:06.000000000 -0500
+++ /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/fs/gfs2/lops.c 2007-07-24 08:50:48.000000000 -0500
@@ -117,7 +117,7 @@ static void buf_lo_before_commit(struct
struct buffer_head *bh;
struct gfs2_log_descriptor *ld;
struct gfs2_bufdata *bd1 = NULL, *bd2;
- unsigned int total = sdp->sd_log_num_buf;
+ unsigned int total;
unsigned int offset = BUF_OFFSET;
unsigned int limit;
unsigned int num;
@@ -127,12 +127,16 @@ static void buf_lo_before_commit(struct
limit = buf_limit(sdp);
/* for 4k blocks, limit = 503 */
+ gfs2_log_lock(sdp);
+ total = sdp->sd_log_num_buf;
bd1 = bd2 = list_prepare_entry(bd1, &sdp->sd_log_le_buf, bd_le.le_list);
while(total) {
num = total;
if (total > limit)
num = limit;
+ gfs2_log_unlock(sdp);
bh = gfs2_log_get_buf(sdp);
+ gfs2_log_lock(sdp);
ld = (struct gfs2_log_descriptor *)bh->b_data;
ptr = (__be64 *)(bh->b_data + offset);
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
@@ -152,21 +156,27 @@ static void buf_lo_before_commit(struct
break;
}
+ gfs2_log_unlock(sdp);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
+ gfs2_log_lock(sdp);
n = 0;
list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
bd_le.le_list) {
+ gfs2_log_unlock(sdp);
bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
+ gfs2_log_lock(sdp);
if (++n >= num)
break;
}
+ BUG_ON(total < num);
total -= num;
}
+ gfs2_log_unlock(sdp);
}
static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
@@ -524,7 +534,7 @@ static void databuf_lo_before_commit(str
struct gfs2_log_descriptor *ld;
unsigned int limit;
unsigned int total_dbuf;
- unsigned int total_jdata = sdp->sd_log_num_jdata;
+ unsigned int total_jdata;
unsigned int num, n;
__be64 *ptr = NULL;
@@ -536,6 +546,7 @@ static void databuf_lo_before_commit(str
*/
gfs2_log_lock(sdp);
total_dbuf = sdp->sd_log_num_databuf;
+ total_jdata = sdp->sd_log_num_jdata;
bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
bd_le.le_list);
while(total_dbuf) {
@@ -621,10 +632,10 @@ static void databuf_lo_before_commit(str
}
gfs2_log_unlock(sdp);
if (bh) {
- set_buffer_mapped(bh);
set_buffer_dirty(bh);
ll_rw_block(WRITE, 1, &bh);
bh = NULL;
+ ptr = NULL;
}
n = 0;
gfs2_log_lock(sdp);
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1 of 5]Bz #248176: GFS2: invalid metadata block, gfs2_meta_indirect_buffer
2007-07-24 14:06 Bob Peterson
@ 2007-07-24 14:11 ` Steven Whitehouse
2007-07-24 16:23 ` David Teigland
0 siblings, 1 reply; 4+ messages in thread
From: Steven Whitehouse @ 2007-07-24 14:11 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
This still doesn't apply I'm afraid,
Steve.
On Tue, 2007-07-24 at 09:06 -0500, Bob Peterson wrote:
> This is a resend of patch 1 with the following changes:
>
> 1. Word wrap is off (I think patch 1 was the only one that word wrapped)
> 2. The debug code was removed.
>
> Bob Peterson
> --
> This is the first of five patches for bug #248176:
>
> There were still some critical variables being manipulated outside
> the log_lock spinlock. That usually resulted in more hangs.
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> --
> --- lops.c 2007-07-12 16:54:06.000000000 -0500
> +++ /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/fs/gfs2/lops.c 2007-07-24 08:50:48.000000000 -0500
> @@ -117,7 +117,7 @@ static void buf_lo_before_commit(struct
> struct buffer_head *bh;
> struct gfs2_log_descriptor *ld;
> struct gfs2_bufdata *bd1 = NULL, *bd2;
> - unsigned int total = sdp->sd_log_num_buf;
> + unsigned int total;
> unsigned int offset = BUF_OFFSET;
> unsigned int limit;
> unsigned int num;
> @@ -127,12 +127,16 @@ static void buf_lo_before_commit(struct
> limit = buf_limit(sdp);
> /* for 4k blocks, limit = 503 */
>
> + gfs2_log_lock(sdp);
> + total = sdp->sd_log_num_buf;
> bd1 = bd2 = list_prepare_entry(bd1, &sdp->sd_log_le_buf, bd_le.le_list);
> while(total) {
> num = total;
> if (total > limit)
> num = limit;
> + gfs2_log_unlock(sdp);
> bh = gfs2_log_get_buf(sdp);
> + gfs2_log_lock(sdp);
> ld = (struct gfs2_log_descriptor *)bh->b_data;
> ptr = (__be64 *)(bh->b_data + offset);
> ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
> @@ -152,21 +156,27 @@ static void buf_lo_before_commit(struct
> break;
> }
>
> + gfs2_log_unlock(sdp);
> set_buffer_dirty(bh);
> ll_rw_block(WRITE, 1, &bh);
> + gfs2_log_lock(sdp);
>
> n = 0;
> list_for_each_entry_continue(bd2, &sdp->sd_log_le_buf,
> bd_le.le_list) {
> + gfs2_log_unlock(sdp);
> bh = gfs2_log_fake_buf(sdp, bd2->bd_bh);
> set_buffer_dirty(bh);
> ll_rw_block(WRITE, 1, &bh);
> + gfs2_log_lock(sdp);
> if (++n >= num)
> break;
> }
>
> + BUG_ON(total < num);
> total -= num;
> }
> + gfs2_log_unlock(sdp);
> }
>
> static void buf_lo_after_commit(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
> @@ -524,7 +534,7 @@ static void databuf_lo_before_commit(str
> struct gfs2_log_descriptor *ld;
> unsigned int limit;
> unsigned int total_dbuf;
> - unsigned int total_jdata = sdp->sd_log_num_jdata;
> + unsigned int total_jdata;
> unsigned int num, n;
> __be64 *ptr = NULL;
>
> @@ -536,6 +546,7 @@ static void databuf_lo_before_commit(str
> */
> gfs2_log_lock(sdp);
> total_dbuf = sdp->sd_log_num_databuf;
> + total_jdata = sdp->sd_log_num_jdata;
> bd2 = bd1 = list_prepare_entry(bd1, &sdp->sd_log_le_databuf,
> bd_le.le_list);
> while(total_dbuf) {
> @@ -621,10 +632,10 @@ static void databuf_lo_before_commit(str
> }
> gfs2_log_unlock(sdp);
> if (bh) {
> - set_buffer_mapped(bh);
> set_buffer_dirty(bh);
> ll_rw_block(WRITE, 1, &bh);
> bh = NULL;
> + ptr = NULL;
> }
> n = 0;
> gfs2_log_lock(sdp);
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Cluster-devel] [PATCH 1 of 5]Bz #248176: GFS2: invalid metadata block, gfs2_meta_indirect_buffer
2007-07-24 14:11 ` Steven Whitehouse
@ 2007-07-24 16:23 ` David Teigland
0 siblings, 0 replies; 4+ messages in thread
From: David Teigland @ 2007-07-24 16:23 UTC (permalink / raw)
To: cluster-devel.redhat.com
On Tue, Jul 24, 2007 at 03:11:39PM +0100, Steven Whitehouse wrote:
> > --- lops.c 2007-07-12 16:54:06.000000000 -0500
> > +++ /usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.x86_64/fs/gfs2/lops.c 2007-07-24 08:50:48.000000000 -0500
That's one heck of a diff command.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-07-24 16:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-24 5:12 [Cluster-devel] [PATCH 1 of 5]Bz #248176: GFS2: invalid metadata block, gfs2_meta_indirect_buffer Bob Peterson
-- strict thread matches above, loose matches on Subject: below --
2007-07-24 14:06 Bob Peterson
2007-07-24 14:11 ` Steven Whitehouse
2007-07-24 16:23 ` David Teigland
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).