From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH regression] dup3: Return an error when oldfd == newfd. Date: Tue, 9 Oct 2012 15:52:43 +0100 Message-ID: <20121009145243.GS2616@ZenIV.linux.org.uk> References: <20121009091521.GM24071@rhmail.home.annexia.org> <20121009092549.GA19680@rhmail.home.annexia.org> <20121009142743.GA20047@rhmail.home.annexia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, Jim Meyering , Linus Torvalds To: "Richard W.M. Jones" Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:33716 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753321Ab2JIOwp (ORCPT ); Tue, 9 Oct 2012 10:52:45 -0400 Content-Disposition: inline In-Reply-To: <20121009142743.GA20047@rhmail.home.annexia.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Oct 09, 2012 at 03:27:43PM +0100, Richard W.M. Jones wrote: > I have tested the attached patch to fix the dup3 regression. > > Rich. > > From 0944e30e12dec6544b3602626b60ff412375c78f Mon Sep 17 00:00:00 2001 > From: "Richard W.M. Jones" > Date: Tue, 9 Oct 2012 14:42:45 +0100 > Subject: [PATCH] dup3: Return an error when oldfd == newfd. > > The following commit: > > commit fe17f22d7fd0e344ef6447238f799bb49f670c6f > Author: Al Viro > Date: Tue Aug 21 11:48:11 2012 -0400 > > take purely descriptor-related stuff from fcntl.c to file.c > > was supposed to be just code motion, but it dropped the following two > lines: > > if (unlikely(oldfd == newfd)) > return -EINVAL; *grumble* So it has; applied, will push to Linus. But now I really want to check if I'd lost anything else in those code moves (and you are right, it was supposed to be just that).