From 590fe34c47cb5c2d836ac76fabc5f160bf31a3f1 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Thu, 1 May 2008 15:53:28 +0100 Subject: [JFFS2] Quiet lockdep false positive. Don't hold f->sem while calling into jffs2_do_create(). It makes lockdep unhappy, and we don't really need it -- the _reason_ it's a false positive is because nobody else can see this inode yet and so nobody will be trying to lock it anyway. Signed-off-by: David Woodhouse --- fs/jffs2/dir.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fs/jffs2/dir.c') diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index c63e7a96af0..2bba3d3435b 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c @@ -208,6 +208,13 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, int mode, f = JFFS2_INODE_INFO(inode); dir_f = JFFS2_INODE_INFO(dir_i); + /* jffs2_do_create() will want to lock it, _after_ reserving + space and taking c-alloc_sem. If we keep it locked here, + lockdep gets unhappy (although it's a false positive; + nothing else will be looking at this inode yet so there's + no chance of AB-BA deadlock involving its f->sem). */ + mutex_unlock(&f->sem); + ret = jffs2_do_create(c, dir_f, f, ri, dentry->d_name.name, dentry->d_name.len); if (ret) -- cgit v1.2.3