From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-ID: <52B10AC7.4080107@huawei.com> Date: Wed, 18 Dec 2013 10:39:03 +0800 From: Li Zefan MIME-Version: 1.0 To: Wang Nan CC: , , Wang Guoli , Subject: Re: [PATCH] jffs2: unlock f->sem on error in jffs2_new_inode() References: <1387332894-33977-1-git-send-email-wangnan0@huawei.com> In-Reply-To: <1387332894-33977-1-git-send-email-wangnan0@huawei.com> Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: The patch should be sent to jffs2 mainling list, which is linux-mtd@lists.infradead.org. It's not needed to cc stable mailing list. Actually I think it's better not to. On 2013/12/18 10:14, Wang Nan wrote: > From: Wang Guoli > > If jffs2_new_inode() succeeds, it returns with f->sem held, and > the caller is responsible for releasing the lock. If it fails, > it still returns with the lock held, but the caller won't release > the lock, which will lead to deadlock. > > Fix it by releasing the lock in jffs2_new_inode() on error. > > Cc: # 2.6.34+ > Signed-off-by: Wang Guoli You should also sign the patch. > --- > fs/jffs2/fs.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-)