All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] [PATCH] GFS2: fix jdata issues
@ 2007-06-01 19:21 Benjamin Marzinski
  2007-06-04  8:49 ` Steven Whitehouse
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Marzinski @ 2007-06-01 19:21 UTC (permalink / raw)
  To: cluster-devel.redhat.com

This is a patch for the first three issues of RHBZ #238162

The first issue is that when you allocate a new page for a file, it will not
start off uptodate. This makes sense, since you haven't written anything to that
part of the file yet.  Unfortunately, gfs2_pin() checks to make sure that the
buffers are uptodate.  The solution to this is to mark the buffers uptodate in
gfs2_commit_write(), after they have been zeroed out and have the data written
into them.  I'm pretty confident with this fix, although it's not completely
obvious that there is no problem with marking the buffers uptodate here.

The second issue is simply that you can try to pin a data buffer that is already
on the incore log, and thus, already pinned. This patch checks to see if this
buffer is already on the log, and exits databuf_lo_add() if it is, just like
buf_lo_add() does.

The third issue is that gfs2_log_flush() doesn't do it's block accounting
correctly.  Both metadata and journaled data are logged, but gfs2_log_flush()
only compares the number of metadata blocks with the number of blocks to commit
to the ondisk journal.  This patch also counts the journaled data blocks.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>

-------------- next part --------------
diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/log.c gfs2-2.6-nmw-070530/fs/gfs2/log.c
--- gfs2-2.6-nmw-070530-clean/fs/gfs2/log.c	2007-06-01 08:33:35.000000000 -0500
+++ gfs2-2.6-nmw-070530/fs/gfs2/log.c	2007-06-01 10:17:00.000000000 -0500
@@ -565,7 +565,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp
 	INIT_LIST_HEAD(&ai->ai_ail1_list);
 	INIT_LIST_HEAD(&ai->ai_ail2_list);
 
-	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf == sdp->sd_log_commited_buf);
+	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf + sdp->sd_log_num_jdata == sdp->sd_log_commited_buf);
 	gfs2_assert_withdraw(sdp,
 			sdp->sd_log_num_revoke == sdp->sd_log_commited_revoke);
 
diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/lops.c gfs2-2.6-nmw-070530/fs/gfs2/lops.c
--- gfs2-2.6-nmw-070530-clean/fs/gfs2/lops.c	2007-06-01 08:33:35.000000000 -0500
+++ gfs2-2.6-nmw-070530/fs/gfs2/lops.c	2007-06-01 10:17:00.000000000 -0500
@@ -475,6 +475,8 @@ static void databuf_lo_add(struct gfs2_s
 		tr->tr_num_buf++;
 		list_add(&bd->bd_list_tr, &tr->tr_list_buf);
 		gfs2_log_unlock(sdp);
+		if (!list_empty(&le->le_list))
+			return;
 		gfs2_pin(sdp, bd->bd_bh);
 		tr->tr_num_buf_new++;
 	} else {
diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/ops_address.c gfs2-2.6-nmw-070530/fs/gfs2/ops_address.c
--- gfs2-2.6-nmw-070530-clean/fs/gfs2/ops_address.c	2007-06-01 08:33:35.000000000 -0500
+++ gfs2-2.6-nmw-070530/fs/gfs2/ops_address.c	2007-06-01 10:17:00.000000000 -0500
@@ -50,6 +50,8 @@ static void gfs2_page_add_databufs(struc
 		end = start + bsize;
 		if (end <= from || start >= to)
 			continue;
+		if (gfs2_is_jdata(ip))
+			set_buffer_uptodate(bh);
 		gfs2_trans_add_bh(ip->i_gl, bh, 0);
 	}
 }

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] [PATCH] GFS2: fix jdata issues
  2007-06-01 19:21 [Cluster-devel] [PATCH] GFS2: fix jdata issues Benjamin Marzinski
@ 2007-06-04  8:49 ` Steven Whitehouse
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Whitehouse @ 2007-06-04  8:49 UTC (permalink / raw)
  To: cluster-devel.redhat.com

Hi,

Now applied to the -nmw git tree. Thanks,

Steve.

On Fri, 2007-06-01 at 14:21 -0500, Benjamin Marzinski wrote:
> This is a patch for the first three issues of RHBZ #238162
> 
> The first issue is that when you allocate a new page for a file, it will not
> start off uptodate. This makes sense, since you haven't written anything to that
> part of the file yet.  Unfortunately, gfs2_pin() checks to make sure that the
> buffers are uptodate.  The solution to this is to mark the buffers uptodate in
> gfs2_commit_write(), after they have been zeroed out and have the data written
> into them.  I'm pretty confident with this fix, although it's not completely
> obvious that there is no problem with marking the buffers uptodate here.
> 
> The second issue is simply that you can try to pin a data buffer that is already
> on the incore log, and thus, already pinned. This patch checks to see if this
> buffer is already on the log, and exits databuf_lo_add() if it is, just like
> buf_lo_add() does.
> 
> The third issue is that gfs2_log_flush() doesn't do it's block accounting
> correctly.  Both metadata and journaled data are logged, but gfs2_log_flush()
> only compares the number of metadata blocks with the number of blocks to commit
> to the ondisk journal.  This patch also counts the journaled data blocks.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> 
> plain text document attachment (238162_mostly_fixed.patch)
> diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/log.c gfs2-2.6-nmw-070530/fs/gfs2/log.c
> --- gfs2-2.6-nmw-070530-clean/fs/gfs2/log.c	2007-06-01 08:33:35.000000000 -0500
> +++ gfs2-2.6-nmw-070530/fs/gfs2/log.c	2007-06-01 10:17:00.000000000 -0500
> @@ -565,7 +565,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp
>  	INIT_LIST_HEAD(&ai->ai_ail1_list);
>  	INIT_LIST_HEAD(&ai->ai_ail2_list);
>  
> -	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf == sdp->sd_log_commited_buf);
> +	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf + sdp->sd_log_num_jdata == sdp->sd_log_commited_buf);
>  	gfs2_assert_withdraw(sdp,
>  			sdp->sd_log_num_revoke == sdp->sd_log_commited_revoke);
>  
> diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/lops.c gfs2-2.6-nmw-070530/fs/gfs2/lops.c
> --- gfs2-2.6-nmw-070530-clean/fs/gfs2/lops.c	2007-06-01 08:33:35.000000000 -0500
> +++ gfs2-2.6-nmw-070530/fs/gfs2/lops.c	2007-06-01 10:17:00.000000000 -0500
> @@ -475,6 +475,8 @@ static void databuf_lo_add(struct gfs2_s
>  		tr->tr_num_buf++;
>  		list_add(&bd->bd_list_tr, &tr->tr_list_buf);
>  		gfs2_log_unlock(sdp);
> +		if (!list_empty(&le->le_list))
> +			return;
>  		gfs2_pin(sdp, bd->bd_bh);
>  		tr->tr_num_buf_new++;
>  	} else {
> diff -urpN --exclude='cscope.*' --exclude-from=gfs2-2.6-nmw-070530-clean/Documentation/dontdiff gfs2-2.6-nmw-070530-clean/fs/gfs2/ops_address.c gfs2-2.6-nmw-070530/fs/gfs2/ops_address.c
> --- gfs2-2.6-nmw-070530-clean/fs/gfs2/ops_address.c	2007-06-01 08:33:35.000000000 -0500
> +++ gfs2-2.6-nmw-070530/fs/gfs2/ops_address.c	2007-06-01 10:17:00.000000000 -0500
> @@ -50,6 +50,8 @@ static void gfs2_page_add_databufs(struc
>  		end = start + bsize;
>  		if (end <= from || start >= to)
>  			continue;
> +		if (gfs2_is_jdata(ip))
> +			set_buffer_uptodate(bh);
>  		gfs2_trans_add_bh(ip->i_gl, bh, 0);
>  	}
>  }



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Cluster-devel] [PATCH] [GFS2] fix jdata issues
  2007-07-09 16:02                                                   ` [Cluster-devel] [PATCH] [DLM] fix socket shutdown swhiteho
@ 2007-07-09 16:02                                                     ` swhiteho
  0 siblings, 0 replies; 3+ messages in thread
From: swhiteho @ 2007-07-09 16:02 UTC (permalink / raw)
  To: cluster-devel.redhat.com

From: Benjamin Marzinski <bmarzins@redhat.com>

This is a patch for the first three issues of RHBZ #238162

The first issue is that when you allocate a new page for a file, it will not
start off uptodate. This makes sense, since you haven't written anything to that
part of the file yet.  Unfortunately, gfs2_pin() checks to make sure that the
buffers are uptodate.  The solution to this is to mark the buffers uptodate in
gfs2_commit_write(), after they have been zeroed out and have the data written
into them.  I'm pretty confident with this fix, although it's not completely
obvious that there is no problem with marking the buffers uptodate here.

The second issue is simply that you can try to pin a data buffer that is already
on the incore log, and thus, already pinned. This patch checks to see if this
buffer is already on the log, and exits databuf_lo_add() if it is, just like
buf_lo_add() does.

The third issue is that gfs2_log_flush() doesn't do it's block accounting
correctly.  Both metadata and journaled data are logged, but gfs2_log_flush()
only compares the number of metadata blocks with the number of blocks to commit
to the ondisk journal.  This patch also counts the journaled data blocks.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 586923d..1fb846f 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -566,7 +566,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl)
 	INIT_LIST_HEAD(&ai->ai_ail1_list);
 	INIT_LIST_HEAD(&ai->ai_ail2_list);
 
-	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf == sdp->sd_log_commited_buf);
+	gfs2_assert_withdraw(sdp, sdp->sd_log_num_buf + sdp->sd_log_num_jdata == sdp->sd_log_commited_buf);
 	gfs2_assert_withdraw(sdp,
 			sdp->sd_log_num_revoke == sdp->sd_log_commited_revoke);
 
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index f82d84d..3e971f2 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -475,6 +475,8 @@ static void databuf_lo_add(struct gfs2_sbd *sdp, struct gfs2_log_element *le)
 		tr->tr_num_buf++;
 		list_add(&bd->bd_list_tr, &tr->tr_list_buf);
 		gfs2_log_unlock(sdp);
+		if (!list_empty(&le->le_list))
+			return;
 		gfs2_pin(sdp, bd->bd_bh);
 		tr->tr_num_buf_new++;
 	} else {
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index fb84478..ac56595 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -50,6 +50,8 @@ static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
 		end = start + bsize;
 		if (end <= from || start >= to)
 			continue;
+		if (gfs2_is_jdata(ip))
+			set_buffer_uptodate(bh);
 		gfs2_trans_add_bh(ip->i_gl, bh, 0);
 	}
 }
-- 
1.5.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-09 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-01 19:21 [Cluster-devel] [PATCH] GFS2: fix jdata issues Benjamin Marzinski
2007-06-04  8:49 ` Steven Whitehouse
  -- strict thread matches above, loose matches on Subject: below --
2007-07-09 16:02 [Cluster-devel] [GFS2/DLM] Pre-pull Patch Posting swhiteho
2007-07-09 16:02 ` [Cluster-devel] [PATCH] [GFS2] flush the glock completely in inode_go_sync swhiteho
2007-07-09 16:02   ` [Cluster-devel] [PATCH] [DLM] fix a couple of races swhiteho
2007-07-09 16:02     ` [Cluster-devel] [PATCH] [GFS2] kernel changes to support new gfs2_grow command swhiteho
2007-07-09 16:02       ` [Cluster-devel] [PATCH] [GFS2] Kernel changes to support new gfs2_grow command (part 2) swhiteho
2007-07-09 16:02         ` [Cluster-devel] [PATCH] [GFS2] use zero_user_page swhiteho
2007-07-09 16:02           ` [Cluster-devel] [PATCH] [GFS2] Addendum patch 2 for gfs2_grow swhiteho
2007-07-09 16:02             ` [Cluster-devel] [PATCH] [GFS2] Reduce size of struct gdlm_lock swhiteho
2007-07-09 16:02               ` [Cluster-devel] [PATCH] [GFS2] Clean up inode number handling swhiteho
2007-07-09 16:02                 ` [Cluster-devel] [PATCH] [GFS2] Quotas non-functional - fix bug swhiteho
2007-07-09 16:02                   ` [Cluster-devel] [PATCH] [DLM] keep dlm from panicing when traversing rsb list in debugfs swhiteho
2007-07-09 16:02                     ` [Cluster-devel] [PATCH] [DLM] block scand during recovery [1/6] swhiteho
2007-07-09 16:02                       ` [Cluster-devel] [PATCH] [DLM] add lock timeouts and warnings [2/6] swhiteho
2007-07-09 16:02                         ` [Cluster-devel] [PATCH] [DLM] dlm_device interface changes [3/6] swhiteho
2007-07-09 16:02                           ` [Cluster-devel] [PATCH] [DLM] cancel in conversion deadlock [4/6] swhiteho
2007-07-09 16:02                             ` [Cluster-devel] [PATCH] [DLM] fix new_lockspace error exit [5/6] swhiteho
2007-07-09 16:02                               ` [Cluster-devel] [PATCH] [DLM] wait for config check during join [6/6] swhiteho
2007-07-09 16:02                                 ` [Cluster-devel] [PATCH] [DLM] fix compile breakage swhiteho
2007-07-09 16:02                                   ` [Cluster-devel] [PATCH] [GFS2] latest gfs2-nmw headers break userland build swhiteho
2007-07-09 16:02                                     ` [Cluster-devel] [PATCH] [DLM] Compile fix swhiteho
2007-07-09 16:02                                       ` [Cluster-devel] [PATCH] [DLM] timeout fixes swhiteho
2007-07-09 16:02                                         ` [Cluster-devel] [PATCH] [DLM] canceling deadlocked lock swhiteho
2007-07-09 16:02                                           ` [Cluster-devel] [PATCH] [DLM] dumping master locks swhiteho
2007-07-09 16:02                                             ` [Cluster-devel] [PATCH] [DLM] show default protocol swhiteho
2007-07-09 16:02                                               ` [Cluster-devel] [PATCH] [GFS2] Quotas non-functional - fix another bug swhiteho
2007-07-09 16:02                                                 ` [Cluster-devel] [PATCH] [GFS2] Make the log reserved blocks depend on block size swhiteho
2007-07-09 16:02                                                   ` [Cluster-devel] [PATCH] [DLM] fix socket shutdown swhiteho
2007-07-09 16:02                                                     ` [Cluster-devel] [PATCH] [GFS2] fix jdata issues swhiteho

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.