linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@logfs.org>
To: srimugunthan dhandapani <srimugunthan.dhandapani@gmail.com>
Cc: linux-mtd@lists.infradead.org, linux-fsdevel@vger.kernel.org
Subject: Re: logfs unmount bug
Date: Fri, 12 Aug 2011 11:34:29 +0200	[thread overview]
Message-ID: <20110812093429.GS26160@logfs.org> (raw)
In-Reply-To: <CAMjNe_f_364ir1iNgFFgh71GP-T_6vroMHFC1R7eazkhcR8c2g@mail.gmail.com>

On Wed, 10 August 2011 16:36:26 +0530, srimugunthan dhandapani wrote:
> 
> > Ok, since I cannot reproduce this at all, can you try the patch below?
> 
> I was using a week-old kernel from git. That may be the problem,
> Can you tell the kernel version that you are using, in which bonnie test passes.
> I am right now trying on kernel 3.0 and i will test and let you know
> the results.

I wouldn't suspect any code changes to cause the different behaviour.
Kernel config and test machine (memsize, etc.) would be more likely
candidates.  So if you could try the patch and send me the output,
that would be useful.

The problem is that two mutually exclusive reasons exist, why
page->private is set.  Either the page is an indirect block and
contains an alias (block->alias_map some bits set) or the page is a
regular data page that is dirty and hasn't been written back yet
(block->reserved_bytes > 0).  There should never be a case when both
happen at the same time.  So what you are seeing is only the symptom
of a bug happening some time before.

Best candidate I have right now would be fixed by the patch below.
But since I cannot reproduce the bug, that patch is just guesswork.

Jörn

-- 
It is the mark of an educated mind to be able to entertain a thought
without accepting it.
-- Aristotle


diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c
index 6c23507..3b12b4f 100644
--- a/fs/logfs/readwrite.c
+++ b/fs/logfs/readwrite.c
@@ -1538,6 +1538,7 @@ static int grow_inode(struct inode *inode, u64 bix, level_t level)
 static int __logfs_write_buf(struct inode *inode, struct page *page, long flags)
 {
 	struct logfs_super *super = logfs_super(inode->i_sb);
+	struct logfs_block *block = logfs_block(page);
 	pgoff_t index = page->index;
 	u64 bix;
 	level_t level;
@@ -1547,8 +1548,10 @@ static int __logfs_write_buf(struct inode *inode, struct page *page, long flags)
 	inode->i_ctime = inode->i_mtime = CURRENT_TIME;
 
 	logfs_unpack_index(index, &bix, &level);
-	if (logfs_block(page) && logfs_block(page)->reserved_bytes)
-		super->s_dirty_bytes -= logfs_block(page)->reserved_bytes;
+	if (block && block->reserved_bytes) {
+		super->s_dirty_bytes -= block->reserved_bytes;
+		block->reserved_bytes = 0;
+	}
 
 	if (index < I0_BLOCKS)
 		return logfs_write_direct(inode, page, flags);
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-08-12  9:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-04 19:35 logfs unmount bug srimugunthan dhandapani
2011-08-05 16:03 ` Jörn Engel
2011-08-06 14:09   ` srimugunthan dhandapani
2011-08-08  8:31     ` Jörn Engel
2011-08-08 14:44       ` srimugunthan dhandapani
2011-08-09 14:58         ` Jörn Engel
2011-08-10 11:06           ` srimugunthan dhandapani
2011-08-12  9:34             ` Jörn Engel [this message]
2011-08-12 17:26               ` srimugunthan dhandapani
2011-08-16 17:17                 ` Jörn Engel
2011-08-21 21:19                   ` srimugunthan dhandapani
2011-08-26 19:49                     ` Jörn Engel
2011-08-29 10:07                       ` srimugunthan dhandapani
2011-08-31  5:58                         ` Jörn Engel
2011-08-31  7:22                           ` srimugunthan dhandapani
2011-08-31  7:49                             ` Jörn Engel
2011-08-31 12:49                               ` srimugunthan dhandapani
2011-08-31 14:17                                 ` Jörn Engel
2011-09-01  6:08                                   ` srimugunthan dhandapani
2011-09-01  9:46                                     ` srimugunthan dhandapani
2011-09-01 21:34                                     ` Jörn Engel

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=20110812093429.GS26160@logfs.org \
    --to=joern@logfs.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=srimugunthan.dhandapani@gmail.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).