From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755175AbcBWUpP (ORCPT ); Tue, 23 Feb 2016 15:45:15 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:51576 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754469AbcBWUpO (ORCPT ); Tue, 23 Feb 2016 15:45:14 -0500 Date: Tue, 23 Feb 2016 21:45:11 +0100 From: Pavel Machek To: Richard Weinberger Cc: linux-mtd@lists.infradead.org, dedekind1@gmail.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ubifs: Implement O_TMPFILE Message-ID: <20160223204510.GA16961@amd> References: <1456048004-20365-1-git-send-email-richard@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456048004-20365-1-git-send-email-richard@nod.at> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > + ui = ubifs_inode(inode); > + > + err = ubifs_init_security(dir, inode, &dentry->d_name); > + if (err) > + goto out_inode; > + > + mutex_lock(&ui->ui_mutex); > + insert_inode_hash(inode); > + d_tmpfile(dentry, inode); > + ubifs_assert(ui->dirty); > + instantiated = 1; > + mutex_unlock(&ui->ui_mutex); > + > + mutex_lock(&dir_ui->ui_mutex); > + err = ubifs_jnl_update(c, dir, &dentry->d_name, inode, 1, 0); > + if (err) > + goto out_cancel; > + mutex_unlock(&dir_ui->ui_mutex); Move the if () below unlock, and make it goto out_inode? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html