From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: ubifs, race between link and unlink/rename? Date: Fri, 15 May 2009 11:44:20 +0300 Message-ID: <1242377060.27996.225.camel@localhost.localdomain> References: <9917.1242232308@jrobl> Reply-To: dedekind@infradead.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: ext-adrian.hunter@nokia.com, linux-fsdevel@vger.kernel.org To: hooanon05@yahoo.co.jp Return-path: Received: from smtp.nokia.com ([192.100.122.233]:26296 "EHLO mgw-mx06.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761679AbZEOIog (ORCPT ); Fri, 15 May 2009 04:44:36 -0400 In-Reply-To: <9917.1242232308@jrobl> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, 2009-05-14 at 01:31 +0900, hooanon05@yahoo.co.jp wrote: > diff --git a/fs/namei.c b/fs/namei.c > index b207821..820c386 100644 > --- a/fs/namei.c > +++ b/fs/namei.c > @@ -2409,9 +2409,12 @@ int vfs_link(struct dentry *old_dentry, struct= inode *dir, struct dentry *new_de > if (error) > return error; > =20 > + error =3D -ENOENT; > mutex_lock(&inode->i_mutex); > - DQUOT_INIT(dir); > - error =3D dir->i_op->link(old_dentry, dir, new_dentry); > + if (inode->i_nlink) { > + DQUOT_INIT(dir); > + error =3D dir->i_op->link(old_dentry, dir, new_dentry); > + } > mutex_unlock(&inode->i_mutex); > if (!error) > fsnotify_link(dir, inode, new_dentry); >=20 Looks correct to me. I wonder what VFS guys think - should we fix UBIFS or this can be done at the VFS layer? --=20 Best regards, Artem Bityutskiy (=D0=91=D0=B8=D1=82=D1=8E=D1=86=D0=BA=D0=B8=D0=B9 =D0=90= =D1=80=D1=82=D1=91=D0=BC) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html