linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
To: akpm@osdl.org
Cc: reiserfs-list@namesys.com, reiserfs-dev@namesys.com,
	linux-fsdevel@vger.kernel.org, Hans Reiser <reiser@namesys.com>,
	Chris Mason <mason@suse.com>
Subject: Re: [PATCH] reiserfs:fix journaling issue regarding fsync()
Date: Mon, 03 Jul 2006 10:31:49 +0900	[thread overview]
Message-ID: <6.0.0.20.2.20060703095844.04122500@172.19.0.2> (raw)
In-Reply-To: <44A7E790.3050003@namesys.com>


At 00:34 06/07/03, Hans Reiser wrote:
 >Chris Mason wrote:
 >
 >>
 >>Thanks, this one looks good.
 >>
 >>
 >Hisashi, please submit it to akpm.

Hi, Andrew.

When write() extends a file(i_size is increased) and fsync() is called,
change of inode must be written to journaling area through fsync().
But,currently the i_trans_id is not correctly updated when i_size
is increased. So fsync() does not kick the journal writer.

Reiserfs_file_write() already updates the transaction when blocks are allocated,
but the case when i_size increases and new blocks are not added is not
correctly treated.

Following patch fix this bug.

Signed-off-by :Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>

diff -Nru linux-2.6.17/fs/reiserfs/file.c linux-2.6.17_fix/fs/reiserfs/file.c
--- linux-2.6.17/fs/reiserfs/file.c	2006-06-18 10:49:35.000000000 +0900
+++ linux-2.6.17_fix/fs/reiserfs/file.c	2006-07-03 09:52:51.000000000 +0900
@@ -860,8 +860,12 @@
  			// this sets the proper flags for O_SYNC to trigger a commit
  			mark_inode_dirty(inode);
  			reiserfs_write_unlock(inode->i_sb);
-		} else
+		} else {
+			reiserfs_write_lock(inode->i_sb);
+			reiserfs_update_inode_transaction(inode);
  			mark_inode_dirty(inode);
+			reiserfs_write_unlock(inode->i_sb);
+		}

  		sd_update = 1;
  	}

Thanks. 

  reply	other threads:[~2006-07-03  1:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20  8:43 [PATCH] reiserfs:fix journaling issue regarding fsync() Hisashi Hifumi
2006-06-23 10:15 ` Vladimir V. Saveliev
2006-06-23 15:53   ` Hans Reiser
2006-06-26  4:39   ` Hisashi Hifumi
2006-06-30  0:47 ` Chris Mason
2006-06-30  1:36   ` Hisashi Hifumi
2006-06-30 12:24     ` Chris Mason
2006-06-30 22:59       ` Hisashi Hifumi
2006-07-01 19:34         ` Chris Mason
2006-07-02 15:34           ` Hans Reiser
2006-07-03  1:31             ` Hisashi Hifumi [this message]
2006-07-03  1:36               ` Andrew Morton
2006-07-03  2:03                 ` Hisashi Hifumi

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=6.0.0.20.2.20060703095844.04122500@172.19.0.2 \
    --to=hifumi.hisashi@oss.ntt.co.jp \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mason@suse.com \
    --cc=reiser@namesys.com \
    --cc=reiserfs-dev@namesys.com \
    --cc=reiserfs-list@namesys.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 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).