Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3337302ybz; Mon, 4 May 2020 00:41:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJm077WWKdecRUOgO6+P+2/ulxhspM38ub3p2Vd9nofa5tN7m0J0IK/WLpxEmYd0qhSPBTf X-Received: by 2002:a05:6402:3121:: with SMTP id dd1mr13627466edb.168.1588578116390; Mon, 04 May 2020 00:41:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588578116; cv=none; d=google.com; s=arc-20160816; b=y3oDbxW4D9kHrhFPh2novN0u8DVPcQuzzYpNWG1J0Cz1By8ZqGWrERtZgiexoBdl0a F/ZTQJ2nvTjvKx9LklA/Y2Jfv5pRAjx7hffx4SInXeqqyWVoBTRWZks5UQ6TXLm4Aq2v bK2C9HlR0OakKs5wgPQdApLX7/xiwSZRDPHrsDPVIOPxduONyFzQKJnWPUukb56ImTfb 4e9KIwcHMuRfbu6YE/apEx+5K0ie5rDhijkcg4+RpVrC8fcR03z+1C1jnt9uf85RpXil SYAtcAml1+alhisTh/9+Ldfg9Outk1NJ8KfYva4+4HnJ04lMqXxuGlLBEIpvbiMJj8At WuFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=k2joa5tIJVPwICNpI03N6qHYqU7dZ+gjfpoSfovCLDc=; b=KFeXMtRLr2hxXGoDYQdflMc05mR6GmLnb2xQ/1Iq0WmZZ0jZNEVgUNEQpBICB8VpBa 3R8vTM01dQ/1NfO9UXWFQ3IRXZb37DopF4F+VxRyLbo2Yh+k4PxfpKAVfyPv5ahghEOc 6wdsw0dQLtBI9D+Iu6K8xxKgmIXQvkattbuSrY+uuCKOtfCD/o74W9QW0LRocro4uqQa kzUedax3M5nmZS5vJlX1V4wWREHIis+7u74K1x0EWUDCpRRrw2ZUpMq0jCLO5YzQ8IrQ RzFs45YodQ/jtOHPh43fSCNTfOn9XmWFrhLG0xZKZfHQWJeRdxWoAargnTXowGWdtZf7 Axhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jguk.org header.s=google header.b=M7l40f3t; 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 dx23si6357194ejb.181.2020.05.04.00.41.23; Mon, 04 May 2020 00:41:56 -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; dkim=pass header.i=@jguk.org header.s=google header.b=M7l40f3t; 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 S1727786AbgEDHii (ORCPT + 99 others); Mon, 4 May 2020 03:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727088AbgEDHii (ORCPT ); Mon, 4 May 2020 03:38:38 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F2BDC061A0E for ; Mon, 4 May 2020 00:38:36 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id h9so9327055wrt.0 for ; Mon, 04 May 2020 00:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jguk.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k2joa5tIJVPwICNpI03N6qHYqU7dZ+gjfpoSfovCLDc=; b=M7l40f3tgf2i73KcxtnTfBzN8vCbcqScmPlx7tu8XGIsoA8srM/iVtaBiTbMf7y4BN beHwMUayNrDWhFxPWorCEvZeJDhoDzTHfS5XsI0dJg/cjZIiHapf6hpuTcs2T9LFYDF2 1V5hCoq3PlVuM3s3PWKISWJhIRb9lwruSdrxveohiL+32BW7ph0FwyI266GrhX/IkavH T0EJnemlJmfbrP0N0dcMZhudw7AAL8IMRzJME0hQTD28UJtj6ld2BnqJHOd1PUE8qBRd qTAsGr6EjdGRiKOmX7mAmDfsaod2NtF3ldjnOnT0aMvfLuu8mBvqhlghVq0KElnlzBP5 SHTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k2joa5tIJVPwICNpI03N6qHYqU7dZ+gjfpoSfovCLDc=; b=Cz6XFZmfvVjVR8SRqNGBVcTBHiJozVgHAryEVqeY7L6IQir5mI+klX+WdnvzZub1ex WaSCEw0+6P52HRAbPro6Agj7fVu9cHesyfaKGpHyD3U+rSaOs5Tac6uEjvDtdWHGo8Fd z4vclcZ20cPkTg/Mo4lSXZtZH7fV0ErvSSENnubZmv3F0lsRz1rwon60kjS/b4x2su5p uEzpHiaNuMkA6Qp2gBIFNMMzCVx83XIQKPYiKkckBkHP0mJ6/sveO7iAf6UJCsA/3DWe gq9LeH+sLTel163TMcPbmTDKZZRes5QJ1ghihS2tfATPP2fr3LMntodXntF8adgEk9PJ DBDw== X-Gm-Message-State: AGi0PuZA+UnB40S6/4yOWyVIv8yYAgOdrNZxg1rwbOcycFWfNk0wLXss xB212slp66lqUACLt4IihN0vdJPSz+M= X-Received: by 2002:adf:8401:: with SMTP id 1mr18336326wrf.241.1588577914983; Mon, 04 May 2020 00:38:34 -0700 (PDT) Received: from [192.168.0.12] (cpc87281-slou4-2-0-cust47.17-4.cable.virginm.net. [92.236.12.48]) by smtp.gmail.com with ESMTPSA id 32sm15922893wrg.19.2020.05.04.00.38.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 00:38:33 -0700 (PDT) Subject: Re: /fs/ext4/namei.c ext4_find_dest_de() To: "Theodore Y. Ts'o" Cc: linux-ext4@vger.kernel.org References: <2edc7d6a-289e-57ad-baf1-477dc240474d@jguk.org> <20200504015122.GB404484@mit.edu> From: Jonny Grant Message-ID: Date: Mon, 4 May 2020 08:38:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200504015122.GB404484@mit.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 04/05/2020 02:51, Theodore Y. Ts'o wrote: > 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 Hi, Is it likely POSIX would introduce this change? It's a shame we're still constrained by old standards (SVr4, BSD), but it's fine if they can be updated. As developer, I can see it feels more confusing for users as it is. This issue shows up in various programs. $ mkdir test $ mkdir test mkdir: cannot create directory ‘test’: File exists I would expect it to be clear for users: $ mkdir test $ mkdir test mkdir: cannot create directory ‘test’: Is a directory The 'mkdir' team don't want to add a call to stat() to give a more appropriate error message. Cheers, Jonny