From: Linus Torvalds <torvalds@linux-foundation.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Remove BKL from FAT/VFAT/MSDOS (v1) (was Re: Fw: Regression caused by bf726e "semaphore: fix,")
Date: Fri, 16 May 2008 18:31:29 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.1.10.0805161812170.3020@woody.linux-foundation.org> (raw)
In-Reply-To: <87abip7p4l.fsf@duaron.myhome.or.jp>
On Sat, 17 May 2008, OGAWA Hirofumi wrote:
> > static struct inode *fat_alloc_inode(struct super_block *sb)
> > {
> > struct msdos_inode_info *ei;
> > - ei = kmem_cache_alloc(fat_inode_cachep, GFP_KERNEL);
> > + ei = kmem_cache_alloc(fat_inode_cachep, GFP_NOFS);
> > if (!ei)
> > return NULL;
> > return &ei->vfs_inode;
>
> Um... do we need this? I think this path is not called from memory
> allocation path...
The issue isn't that *this* is called by memory allocation paths, but
whether this can hold the lock and then some memory allocation path calls
back to the filesystem two write something out - and deadlock.
In other words, the chain is something like this:
msdos_lookup
lock_super() ****
fat_build_inode ->
new_inode() ->
s->s_ops->alloc_inode = fat_alloc_inode ->
kmem_cache_alloc() ->
.. pageout ..
sync_inodes ->
(or any other writeout)
lock_super() ****
and now it deadlocks.
In other words, the kmem_cache_alloc() must _not_ be allowed to actually
cause a filesystem writeout, and that's what GFP_NOFS is all about.
That said, just removing the lock-kernel entirely obviously would not have
that problem either, but I feel safer at least keeping the same locking it
had, rather than removing locking entirely.
Linus
next prev parent reply other threads:[~2008-05-17 1:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080510121020.f33c83f7.akpm@linux-foundation.org>
[not found] ` <20080511073338.GA17137@elte.hu>
[not found] ` <20080511075522.GA18214@elte.hu>
[not found] ` <Pine.LNX.4.64.0805111150250.32758@titan.stealer.net>
[not found] ` <20080511125731.GA28174@elte.hu>
[not found] ` <alpine.LFD.1.10.0805110941540.3330@woody.linux-foundation.org>
[not found] ` <20080511111210.77858eb4.akpm@linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0805111221070.3188@woody.linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0805111243250.3188@woody.linux-foundation.org>
[not found] ` <20080511235112.GA16101@elte.hu>
[not found] ` <alpine.LFD.1.10.0805120155490.3514@apollo.tec.linutronix.de>
[not found] ` <alpine.LFD.1.10.0805120723440.3188@woody.linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0805121659470.3514@apollo.tec.linutronix.de>
[not found] ` <alpine.LFD.1.10.0805121324410.3019@woody.linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0805161025510.3255@apollo.tec.linutronix.de>
[not found] ` <alpine.LFD.1.10.0805160906580.2941@woody.linux-foundation.org>
[not found] ` <alpine.LFD.1.10.0805160950180.2941@woody.linux-foundation.org>
2008-05-16 22:36 ` Linus Torvalds
2008-05-16 22:58 ` Linus Torvalds
2008-05-17 0:25 ` OGAWA Hirofumi
2008-05-17 1:31 ` Linus Torvalds [this message]
2008-05-29 20:45 ` Tony Luck
2008-05-29 21:37 ` Linus Torvalds
2008-05-29 23:13 ` Jonathan Corbet
2008-05-29 23:17 ` Linus Torvalds
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=alpine.LFD.1.10.0805161812170.3020@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=akpm@linux-foundation.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®