public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Josh Boyer <jwboyer@gmail.com>,
	linux-mtd@lists.infradead.org, Joakim.Tjernlund@transmode.se,
	giulio fedel <giulio.fedel@andorsystems.com>
Subject: Re: jffs2 kernel dump with 2.6.22-rc7
Date: Sun, 19 Aug 2007 20:33:24 -0700	[thread overview]
Message-ID: <46C90B84.1060208@gmail.com> (raw)
In-Reply-To: <1187513787.28494.9.camel@shinybook.infradead.org>

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

David Woodhouse wrote:
> I think I'd prefer to make the can_mark_obsolete path also hold
> alloc_sem while it's doing its thing.
> 
> Giulio, please could you verify that this patch also fixes the problem?
> 
> diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
> index bc61859..664c164 100644
> --- a/fs/jffs2/write.c
> +++ b/fs/jffs2/write.c
> @@ -566,6 +566,9 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
>  		struct jffs2_full_dirent **prev = &dir_f->dents;
>  		uint32_t nhash = full_name_hash(name, namelen);
>  
> +		/* We don't actually want to reserve any space, but we do
> +		   want to be holding the alloc_sem when we write to flash */
> +		down(&c->alloc_sem);
>  		down(&dir_f->sem);
>  
>  		while ((*prev) && (*prev)->nhash <= nhash) {
> 
> 

I've tested this patch with a 2.6.23-rc3-git2 snapshot and it solves
the problem for me (see attachment for an example of what I was
experiencing).

Zac

[-- Attachment #2: bug.txt --]
[-- Type: text/plain, Size: 2376 bytes --]

Kernel BUG at ffffffff8823eedc [verbose debug info unavailable]
invalid opcode: 0000 [1] PREEMPT SMP
CPU 0
Modules linked in: squashfs loop jffs2 block2mtd mtdblock mtd_blkdevs mtdchar mtd 8139too e100 mii evdev psmouse cpufreq_ondemand freq_table ipv6 snd_pcm_oss snd_mixer_oss snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm snd_timer snd soundcore snd_page_alloc nfsd exportfs lockd sunrpc ipt_REJECT xt_tcpudp ipt_LOG xt_limit ipt_recent nf_conntrack_ipv4 xt_state nf_conntrack nfnetlink iptable_filter ip_tables x_tables rtc usbcore ntfs dm_mod
Pid: 7379, comm: rsync Not tainted 2.6.23-rc2-0807-x86-64 #1
RIP: 0010:[<ffffffff8823eedc>]  [<ffffffff8823eedc>] :jffs2:jffs2_link_node_ref+0x1d/0x153
RSP: 0000:ffff810038547c38  EFLAGS: 00210246
RAX: 0000000000000000 RBX: ffffc200008cef40 RCX: ffff8100380bb5b0
RDX: 0000000001ea8dff RSI: ffffc200008cef40 RDI: ffff810037dba000
RBP: ffff810038547c68 R08: ffff8100380bb5b0 R09: 0000000000000044
R10: 0000000000000044 R11: 0000000000200296 R12: ffff810037dba000
R13: 0000000000000044 R14: ffff810037dba188 R15: ffff8100380bb5b0
FS:  0000000000000000(0000) GS:ffffffff80581000(0063) knlGS:00000000f7c748d0
CS:  0010 DS: 002b ES: 002b CR0: 000000008005003b
CR2: 00000000f69fa000 CR3: 000000003ed35000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process rsync (pid: 7379, threadinfo ffff810038546000, task ffff8100202608a0)
Stack:  0000000000000001 ffffffffffffff10 ffffffff80280bce ffffc200008cef40
 ffff810037dba000 0000000001ea8dff ffff810038547ca8 ffffffff88240540
 0000004438b4cca8 0000000001ea8dfc 0000000000000000 ffff810037dba000
Call Trace:
 [<ffffffff80280bce>] kmem_cache_alloc+0x49/0x6f
 [<ffffffff88240540>] :jffs2:jffs2_add_physical_node_ref+0x9e/0x129
 [<ffffffff88242e92>] :jffs2:jffs2_write_dnode+0x2d0/0x337
 [<ffffffff88247d06>] :jffs2:jffs2_do_setattr+0x385/0x52d
 [<ffffffff80239eee>] current_fs_time+0x22/0x29
 [<ffffffff88247f31>] :jffs2:jffs2_setattr+0xd/0xf
 [<ffffffff80298b22>] notify_change+0x160/0x30e
 [<ffffffff802831bf>] sys_fchmodat+0xac/0xd5
 [<ffffffff8029a1ba>] mntput_no_expire+0x20/0xa2
 [<ffffffff80224cba>] sys32_lstat64+0x29/0x34
 [<ffffffff802831fb>] sys_chmod+0x13/0x15
 [<ffffffff802245c2>] ia32_sysret+0x0/0xa

  reply	other threads:[~2007-08-20  3:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8c7950360707091227v14daf14cs48fb1377e903be6c@mail.gmail.com>
2007-08-01 18:41 ` jffs2 kernel dump with 2.6.22-rc7 shanevolpe
2007-08-17 17:14   ` giulio fedel
2007-08-18 21:08     ` Zac Medico
2007-08-18 21:42     ` Josh Boyer
2007-08-19  0:59       ` Joakim Tjernlund
2007-08-19  8:56       ` David Woodhouse
2007-08-20  3:33         ` Zac Medico [this message]
2007-08-20  9:08         ` giulio fedel
2007-07-10 11:09 shanevolpe

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=46C90B84.1060208@gmail.com \
    --to=zmedico@gmail.com \
    --cc=Joakim.Tjernlund@transmode.se \
    --cc=dwmw2@infradead.org \
    --cc=giulio.fedel@andorsystems.com \
    --cc=jwboyer@gmail.com \
    --cc=linux-mtd@lists.infradead.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