mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Vladimir V. Saveliev" <vs@namesys.com>
To: Suzuki <suzuki@in.ibm.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>,
	reiserfs-dev@namesys.com, linux-kernel@vger.kernel.org,
	reiserfs-list@namesys.com, akpm@osdl.org, suparna@in.ibm.com,
	amitarora@in.ibm.com
Subject: Re: [BUG] Reiserfs: reiserfs_panic while running fs stress tests
Date: Fri, 12 May 2006 11:33:43 +0400	[thread overview]
Message-ID: <1147419223.8001.5.camel@tribesman.namesys.com> (raw)
In-Reply-To: <44642F0E.4050500@in.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Hello

On Fri, 2006-05-12 at 12:15 +0530, Suzuki wrote:
> Randy.Dunlap wrote:
> > On Fri, 05 May 2006 10:22:21 +0530 Suzuki wrote:
> > 
> > 
> >>Hi,
> >>
> >>
> >>I was working on a reiserfs panic with 2.6.17-rc3, while running fs
> >>stress tests.
> > 
> > 
> > Hi,
> > What test(s) do you use?
> 
> The problem was initially hit while running the following tests 
> simultaneously..
> IOZone, bonnie++, dbench, fs_inod, fs_maim, fsstress, fsx_linux, 
> postmark, tiobench.
> 
> As I had mentioned in my post, I have a simple testcase to trigger the 
> panic which can hit the code path explained below.
> 
> The root cause of the problem is (as mentioned in the earlier post):
> 
>   Whenever there is an extending DIO write operation, the fs would
> create a safe link so as to ensure the file size consistent, if there is
> crash in between the DIO. This will be deleted once the write operation
> finishes.
> 

I am not sure why safe link is needed for write. Maybe one who added
that still remembers why that was done and can explain, please?

Suzuki, would you please try the attached patch?



[-- Attachment #2: reiserfs-dont-use-safelink-on-write.patch --]
[-- Type: text/x-patch, Size: 1978 bytes --]


diff -puN fs/reiserfs/file.c~reiserfs-dont-use-safelink-on-write fs/reiserfs/file.c
--- linux-2.6.17-rc3/fs/reiserfs/file.c~reiserfs-dont-use-safelink-on-write	2006-05-12 11:28:16.000000000 +0400
+++ linux-2.6.17-rc3-vs/fs/reiserfs/file.c	2006-05-12 11:29:16.000000000 +0400
@@ -1305,54 +1305,7 @@ static ssize_t reiserfs_file_write(struc
 	}
 
 	if (file->f_flags & O_DIRECT) {	// Direct IO needs treatment
-		ssize_t result, after_file_end = 0;
-		if ((*ppos + count >= inode->i_size)
-		    || (file->f_flags & O_APPEND)) {
-			/* If we are appending a file, we need to put this savelink in here.
-			   If we will crash while doing direct io, finish_unfinished will
-			   cut the garbage from the file end. */
-			reiserfs_write_lock(inode->i_sb);
-			err =
-			    journal_begin(&th, inode->i_sb,
-					  JOURNAL_PER_BALANCE_CNT);
-			if (err) {
-				reiserfs_write_unlock(inode->i_sb);
-				return err;
-			}
-			reiserfs_update_inode_transaction(inode);
-			add_save_link(&th, inode, 1 /* Truncate */ );
-			after_file_end = 1;
-			err =
-			    journal_end(&th, inode->i_sb,
-					JOURNAL_PER_BALANCE_CNT);
-			reiserfs_write_unlock(inode->i_sb);
-			if (err)
-				return err;
-		}
-		result = generic_file_write(file, buf, count, ppos);
-
-		if (after_file_end) {	/* Now update i_size and remove the savelink */
-			struct reiserfs_transaction_handle th;
-			reiserfs_write_lock(inode->i_sb);
-			err = journal_begin(&th, inode->i_sb, 1);
-			if (err) {
-				reiserfs_write_unlock(inode->i_sb);
-				return err;
-			}
-			reiserfs_update_inode_transaction(inode);
-			mark_inode_dirty(inode);
-			err = journal_end(&th, inode->i_sb, 1);
-			if (err) {
-				reiserfs_write_unlock(inode->i_sb);
-				return err;
-			}
-			err = remove_save_link(inode, 1 /* truncate */ );
-			reiserfs_write_unlock(inode->i_sb);
-			if (err)
-				return err;
-		}
-
-		return result;
+	  	return generic_file_write(file, buf, count, ppos);
 	}
 
 	if (unlikely((ssize_t) count < 0))

_

  reply	other threads:[~2006-05-12  7:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-05  4:52 Suzuki
2006-05-11 17:50 ` Randy.Dunlap
2006-05-12  6:45   ` Suzuki
2006-05-12  7:33     ` Vladimir V. Saveliev [this message]
2006-11-22  1:23       ` Suzuki

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=1147419223.8001.5.camel@tribesman.namesys.com \
    --to=vs@namesys.com \
    --cc=akpm@osdl.org \
    --cc=amitarora@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=reiserfs-dev@namesys.com \
    --cc=reiserfs-list@namesys.com \
    --cc=suparna@in.ibm.com \
    --cc=suzuki@in.ibm.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

Powered by JetHome