From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755642Ab2BFRLz (ORCPT ); Mon, 6 Feb 2012 12:11:55 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:43166 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755571Ab2BFRLy (ORCPT ); Mon, 6 Feb 2012 12:11:54 -0500 Date: Mon, 6 Feb 2012 17:11:52 +0000 From: Al Viro To: Artem Bityutskiy Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Torvalds Subject: Re: [RFC] killing boilerplate checks in ->link/->mkdir/->rename Message-ID: <20120206171152.GG23916@ZenIV.linux.org.uk> References: <20120202012258.GQ23916@ZenIV.linux.org.uk> <20120202212400.GR23916@ZenIV.linux.org.uk> <20120203011612.GS23916@ZenIV.linux.org.uk> <20120203170825.GX23916@ZenIV.linux.org.uk> <1328518244.22240.25.camel@sauron.fi.intel.com> <20120206135655.GF23916@ZenIV.linux.org.uk> <1328547955.22240.39.camel@sauron.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1328547955.22240.39.camel@sauron.fi.intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 06, 2012 at 07:05:55PM +0200, Artem Bityutskiy wrote: > On Mon, 2012-02-06 at 13:56 +0000, Al Viro wrote: > > On Mon, Feb 06, 2012 at 10:50:44AM +0200, Artem Bityutskiy wrote: > > > > > WRT 'sen_nlink()' - I can use it instead of 'drop_nlink()'/'inc_nlink()' > > > of course. But I do not really see why is this better. E.g., > > > 'drop_nlink()' additionally gives me ' WARN_ON()' in case of 'i_nlink' > > > wrapping. > > > > So does inc_nlink() when you are asking to get from nlink=0 to nlink=1. > > I.e. on failure exit in your unlink()... > > Indeed! I'll switch to 'clear_nlink(inode)' and 'set_nlink(inode, 1)' > for those inodes which are being unliked. Huh? I thought ubifs allowed link(2)... IOW, i_nlink could've been greater than 1 when you called ubifs_unlink().