Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
To: andrea.gelmini-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org,
	users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org
Subject: Re: Crash...
Date: Wed, 29 Jul 2009 11:46:04 +0900 (JST)	[thread overview]
Message-ID: <20090729.114604.56042421.ryusuke@osrg.net> (raw)
In-Reply-To: <9cdbb57f0907231402i1a92cb4qfe5a9d81346a4665-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: Text/Plain, Size: 2262 bytes --]

Hi Andrea,
On Thu, 23 Jul 2009 23:02:47 +0200, Andrea Gelmini wrote:
> 2009/7/23 Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>:
> > It also suggests that an inconsistent state in page cache of B-tree
> > nodes hit the function; the function found a dirty page, but the page
> > didn't have buffer heads which was supposed to be impossible for the
> > b-tree of nilfs.
> 
> Well,
>    thanks for your quick reply.
>    Anyway, I can reproduce the same problem doing same things with
> stable kernel (2.6.29.6) and nilfs2-module from git repository.
>    I do this:
>    -> mkfs.nilfs2 -b 1024 /dev/mapper/VG-NilfHome (maybe the problem
> is the 1K block size?)
>    -> mount /dev/mapper/VG-NilfHome /tmp/test/
>    -> I run mirrordir (here's exactly as a "cp -a")
> 
>    It stucks at the same file as the crash before.
>    It's a 5G file, if it could help.

I found a bug which may cause the kernel oops you reported.
The bug can arise only if buffer size is smaller than page size.

Here I attach the patch that will hopefully fix this problem.

Could you test if the patch makes a difference for the same file ?

Regards,
Ryusuke Konishi
---
 fs/nilfs2/segment.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
index 8b5e477..51ff3d0 100644
--- a/fs/nilfs2/segment.c
+++ b/fs/nilfs2/segment.c
@@ -1859,12 +1859,26 @@ static void nilfs_end_page_io(struct page *page, int err)
 	if (!page)
 		return;
 
-	if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page))
+	if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) {
 		/*
 		 * For b-tree node pages, this function may be called twice
 		 * or more because they might be split in a segment.
 		 */
+		if (PageDirty(page)) {
+			/*
+			 * For pages holding split b-tree node buffers, dirty
+			 * flag on the buffers may be cleared discretely.
+			 * In that case, the page is once redirtied for
+			 * remaining buffers, and it must be cancelled if
+			 * all the buffers get cleaned later.
+			 */
+			lock_page(page);
+			if (nilfs_page_buffers_clean(page))
+				__nilfs_clear_page_dirty(page);
+			unlock_page(page);
+		}
 		return;
+	}
 
 	__nilfs_end_page_io(page, err);
 }
-- 
1.6.3.3


[-- Attachment #2: nilfs2-fix-oops-due-to-inconsistent-page-state.patch.bz2 --]
[-- Type: Application/Octet-Stream, Size: 1128 bytes --]

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
users mailing list
users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org
https://www.nilfs.org/mailman/listinfo/users

  parent reply	other threads:[~2009-07-29  2:46 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 12:55 Crash Andrea Gelmini
     [not found] ` <9cdbb57f0907230555k768383c2ld1690d31cc6fff83-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-23 16:12   ` Crash Ryusuke Konishi
     [not found]     ` <20090724.011249.110726474.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-07-23 21:02       ` Crash Andrea Gelmini
     [not found]         ` <9cdbb57f0907231402i1a92cb4qfe5a9d81346a4665-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-23 21:20           ` Crash Andrea Gelmini
     [not found]             ` <9cdbb57f0907231420y4122d649y69fee2273a05b4cc-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-27  0:40               ` Crash Jiro SEKIBA
     [not found]                 ` <873a8jhsbd.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org>
2009-07-27  7:58                   ` Crash Andrea Gelmini
2009-07-29  2:49                   ` Crash Jiro SEKIBA
     [not found]                     ` <87eis0mcev.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org>
2009-07-29  3:46                       ` Crash Ryusuke Konishi
     [not found]                         ` <20090729.124638.38314632.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-07-29  4:40                           ` Crash Jiro SEKIBA
     [not found]                             ` <874osw14pz.wl%jir-27yqGEOhnJbQT0dZR+AlfA@public.gmane.org>
2009-07-29  5:08                               ` Crash Ryusuke Konishi
     [not found]                                 ` <20090729.140821.103585622.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-08-10  6:54                                   ` kernel oops on shrink_page_list (was Re: Crash...) Ryusuke Konishi
     [not found]                                     ` <20090810.155420.42596352.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-08-25 10:50                                       ` kernel oops on shrink_page_list Ryusuke Konishi
2009-08-01 13:39                   ` Crash Andrea Gelmini
     [not found]                     ` <9cdbb57f0908010639l26c26182ma121b0d7672003e0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-02  7:58                       ` Crash Jiro SEKIBA
2009-07-24  8:58           ` Crash Reinoud Zandijk
     [not found]             ` <20090724085803.GA23256-5cYspOl2ggRz6xQTk39kMVfVdRo2wo/d@public.gmane.org>
2009-07-24  9:47               ` Crash Andrea Gelmini
     [not found]                 ` <9cdbb57f0907240247n5ffd6f81yaee39eb386516c25-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-24 10:02                   ` Crash Reinoud Zandijk
2009-07-24 10:47                   ` Crash Ryusuke Konishi
2009-07-24 10:46               ` Crash Ryusuke Konishi
     [not found]                 ` <20090724.194617.88653682.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-07-24 11:13                   ` Crash Reinoud Zandijk
     [not found]                     ` <20090724111333.GE23256-5cYspOl2ggRz6xQTk39kMVfVdRo2wo/d@public.gmane.org>
2009-07-27  7:45                       ` Crash Ryusuke Konishi
2009-07-29  2:46           ` Ryusuke Konishi [this message]
     [not found]             ` <20090729.114604.56042421.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-08-01 13:36               ` Crash Andrea Gelmini
     [not found]                 ` <9cdbb57f0908010636u7296da29p61df192dc35d0d12-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-01 13:56                   ` Crash Ryusuke Konishi
  -- strict thread matches above, loose matches on Subject: below --
2010-02-10  0:59 crash Ryusuke Konishi
     [not found] ` <201002100059.AA01340-ZdTO5nnmHvkOizVVqyxoihMFgDP4sedm@public.gmane.org>
2010-02-10  4:07   ` crash Ryusuke Konishi
     [not found]     ` <ee5afd761002092314i1ba1ec66ie6fe7d0f22d6927e@mail.gmail.com>
     [not found]       ` <ee5afd761002092314i1ba1ec66ie6fe7d0f22d6927e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-10  7:26         ` crash Jan de Kruyf
     [not found]           ` <ee5afd761002092326k3bb3a74fq7145cdb9925d88d5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-11  5:30             ` crash Ryusuke Konishi
     [not found]               ` <20100211.143001.184824921.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-02-11 17:43                 ` crash Jan de Kruyf
     [not found]                   ` <ee5afd761002110943y1ca061bdi610de2f1a5df3c32-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-14  7:34                     ` crash Ryusuke Konishi
     [not found] <ee5afd761002182235r1fe20b0kc7ef7082a5a907e3@mail.gmail.com>
     [not found] ` <ee5afd761002182235r1fe20b0kc7ef7082a5a907e3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-02-20 13:38   ` crash Ryusuke Konishi

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=20090729.114604.56042421.ryusuke@osrg.net \
    --to=ryusuke-sg5x7nla6pw@public.gmane.org \
    --cc=andrea.gelmini-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
    --cc=users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org \
    /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