diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2007-06-01 15:21:38 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-07-09 03:23:08 -0400 |
commit | ddf4b426aababdae4cb96326d7aeb9d119f42c50 (patch) | |
tree | 26aceb619f34e7b58e50a0ad0dc4db4e69664edc /fs/gfs2/lops.c | |
parent | afb853fb4eec380b492a3c369f837359359c28e8 (diff) |
[GFS2] fix jdata issues
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>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index f82d84d05d23..3e971f25120d 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) | |||
475 | tr->tr_num_buf++; | 475 | tr->tr_num_buf++; |
476 | list_add(&bd->bd_list_tr, &tr->tr_list_buf); | 476 | list_add(&bd->bd_list_tr, &tr->tr_list_buf); |
477 | gfs2_log_unlock(sdp); | 477 | gfs2_log_unlock(sdp); |
478 | if (!list_empty(&le->le_list)) | ||
479 | return; | ||
478 | gfs2_pin(sdp, bd->bd_bh); | 480 | gfs2_pin(sdp, bd->bd_bh); |
479 | tr->tr_num_buf_new++; | 481 | tr->tr_num_buf_new++; |
480 | } else { | 482 | } else { |