Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3158803ybz; Sun, 3 May 2020 18:53:01 -0700 (PDT) X-Google-Smtp-Source: APiQypIo/rf1ggu0jx0jEcX8U2uZtjTFuSxPje/kRRZ1O+a6Sotv3qhKzS8xn0tq8H47wXaB9qra X-Received: by 2002:a17:906:6411:: with SMTP id d17mr13184418ejm.109.1588557180956; Sun, 03 May 2020 18:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588557180; cv=none; d=google.com; s=arc-20160816; b=FehHZaB7IUiuealDK9Mtpl2T79Y/guoyamfJZ4hMf7GXFPoWzkSKkCdnUO+/nUvuJD T3kxF7k8lEBOQ1PQ/svqznSN2+955a/JBOHkUK1E2EtdFchDs5x5NHAvAWh+EEzFMo9A dqPoErv8Y0Y+3oKnegtxg9JiYii8NAS7ez978oBCYC9VmwHVgaBhCE3UeMuwDC+JUFIQ HlnROpdG29sJWg+8MMYMdtHJF7pSUB3QJTkG9EUznFdEL6jidDAEUM39BF1+A2sObgfQ KIN2J65yTXzgetqTEwDINQhH9XrcRIr7UKC1RmxFkYQbgmLJ/uR/r1It+BrL9+mUpw0C nytw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=XIKjI5eG8L7dcVyCFj+/aYOK3Qi2eDNDLEyL7mY9vDw=; b=u+x42POZJfRC7bfswcdazR9Hv76DgIoTl/M1VtfsuGJSny6eCdiucRj/n7jtcPv/HF iif1Rsyz/tUAgciSvtiltJ8zF26lIf8mjPKuoTgoKRITqGDcu5vKHbKFaQCwhPe6d70w J7IDgT+jbk29M4ygaoCEkISPOESajlM1SDodaoN7GNbGAQ3wdJGSg7Va8lP3F3KnpC63 LJpKC88TRQipYqE5a4UBgxmjJ0sYzpTuH8IrCxj1YuJn9Q/QDKQ4p/IhiPA5LyRKCh2V 4ddTSWsCy5+ZMK0QLPhH6QsMagp6mLC7NkHGX+bAccCQNFkIWSAujZSo8sugvpVqceY4 9iew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu15si5611028edb.129.2020.05.03.18.52.27; Sun, 03 May 2020 18:53:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbgEDBv1 (ORCPT + 99 others); Sun, 3 May 2020 21:51:27 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:59811 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726377AbgEDBv1 (ORCPT ); Sun, 3 May 2020 21:51:27 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 0441pM0b020436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 3 May 2020 21:51:23 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id B3FD642085D; Sun, 3 May 2020 21:51:22 -0400 (EDT) Date: Sun, 3 May 2020 21:51:22 -0400 From: "Theodore Y. Ts'o" To: Jonny Grant Cc: linux-ext4@vger.kernel.org Subject: Re: /fs/ext4/namei.c ext4_find_dest_de() Message-ID: <20200504015122.GB404484@mit.edu> References: <2edc7d6a-289e-57ad-baf1-477dc240474d@jguk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2edc7d6a-289e-57ad-baf1-477dc240474d@jguk.org> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, May 03, 2020 at 02:00:25PM +0100, Jonny Grant wrote: > Hi > > I noticed that mkdir() returns EEXIST if a directory already exists. > strerror(EEXIST) text is "File exists" > > Can ext4_find_dest_de() be amended to return EISDIR if a directory already > exists? This will make the error message clearer. No; this will confuse potentially a large number of existing programs. Also, the current behavior is required by POSIx and the Single Unix Specification standards. https://pubs.opengroup.org/onlinepubs/009695399/ Regards, - Ted