linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
To: "Vladimir V. Saveliev" <vs@namesys.com>
Cc: reiser@namesys.com, reiserfs-dev@namesys.com,
	reiserfs-list@namesys.com, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] reiserfs:fix journaling issue regarding fsync()
Date: Mon, 26 Jun 2006 13:39:01 +0900	[thread overview]
Message-ID: <6.0.0.20.2.20060626095550.041272e0@172.19.0.2> (raw)
In-Reply-To: <1151057737.6355.28.camel@tribesman.namesys.com>


At 19:15 06/06/23, Vladimir V. Saveliev wrote:
 >Hello
 >
 >Sorry, but afaics reiserfs' fsync works as it is supposed to.
 >I experiment with the attached program. After reboot I make sure that
 >file has "new file size".
 >

I modified your program shown as below.The only difference is that a for
loop is added. Write() and fsync() tests are repeated 100times.

#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>

int main(int argc, char **argv)
{
	int fd,i;
	struct stat st;

	fd = open(argv[1], O_WRONLY | O_APPEND);
	if (fd == -1) {
		perror("open failed");
		return 0;
	}
	if (fstat(fd, &st)) {
		perror("stat failed");
		return 0;
	}
	printf("old file size %d\n", st.st_size);
	for(i=0;i<100;i++) {
		if (write(fd, "hello", 5) != 5) {
			perror("write failed");
			return 0;
		}

		if (fstat(fd, &st)) {
			perror("stat failed");
			return 0;
		}
		printf("new file size %d\n", st.st_size);
		if (fsync(fd)) {
			perror("fsync failed");
			return 0;
		}
	}
	printf("rebooting"); fflush(stdout);
	system("reboot -f -n");
	return 0;
}

I tested with this program toward reiserfs (2.6.17 and 2.6.17 with my patch).
After I made an empty file, I run this program.
I performed this test 10times each.
Following results are obtained.

				success 	fail
2.6.17			5		5
2.6.17 with my patch	10		0

"Success" means that file size is 500bytes after reboot.
"Fail" means that file size is less than 500bytes after reboot.

So, this result showed that my patch is needed.

Thanks. 


  parent reply	other threads:[~2006-06-26  4:38 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 [this message]
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
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.20060626095550.041272e0@172.19.0.2 \
    --to=hifumi.hisashi@oss.ntt.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=reiser@namesys.com \
    --cc=reiserfs-dev@namesys.com \
    --cc=reiserfs-list@namesys.com \
    --cc=vs@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).