From patchwork Mon Dec 16 20:41:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13910337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCBF4E7717F for ; Mon, 16 Dec 2024 20:43:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4AAAE6B00CF; Mon, 16 Dec 2024 15:43:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 47F5C6B00D0; Mon, 16 Dec 2024 15:43:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 31FCD6B00D1; Mon, 16 Dec 2024 15:43:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 12D346B00CF for ; Mon, 16 Dec 2024 15:43:15 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id CED291A00E9 for ; Mon, 16 Dec 2024 20:43:14 +0000 (UTC) X-FDA: 82901996184.23.B188D6A Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id F36121C0003 for ; Mon, 16 Dec 2024 20:42:41 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="J/qjDZWj"; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734381773; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E8xdMX/uFcK2gZEOhPcswqOMkVx14v1DliFqQKEHbv4=; b=gAFZ7RBwH81x0haoLF8I7YuazGAWn3FFJx9aUYo1Duo9cU/XwXeSr1O9mcbZZFiSLo31AP /hLHAh4jbSVUqr7VCDOGM8YlLQKXh/5GT/wq+ZtmtbUj3PqDxW/9JUhKMh0mG7IceY7zfy 0fRxX25TTBQmEswJrfcgdv4LDmYpjDA= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734381773; a=rsa-sha256; cv=none; b=GlsYZL7hZ2L7/gd/v/jsH4Jp0P+Hk+itdU9mIZyuDmn3INiENWpEETWHbL2+PcS5M1LU2I sYhPp9Zmxqp1tKvRdj10LzTQ2d3KN16B2rlQG8ZX/W75+QNgjNOm/55OcuJgWPDi1Rjs4j s6n5xfcdopZ0Ic9IhLdCveRQL80MDtk= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="J/qjDZWj"; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1734381792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E8xdMX/uFcK2gZEOhPcswqOMkVx14v1DliFqQKEHbv4=; b=J/qjDZWjeIwiIJ+4ABl2jMwu8w8IGOHcDyfEGjZZRtJu6cMWVA2PCLRjQihWVuDE4lH/w4 eSZ4xYAgOkgTUqje+ojhefYROBhDxQhqi+ObJvEREYgrBJDcVHuD5P0A8xHxQFnxhZrugZ hw+w7D60K/MQTZFNUkMgrukZ8+Auheg= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-532-gCJ-nQOGNieLkDA4vcTqVg-1; Mon, 16 Dec 2024 15:43:09 -0500 X-MC-Unique: gCJ-nQOGNieLkDA4vcTqVg-1 X-Mimecast-MFC-AGG-ID: gCJ-nQOGNieLkDA4vcTqVg Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9173F1955D4E; Mon, 16 Dec 2024 20:43:05 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.48]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 42CA930044C1; Mon, 16 Dec 2024 20:42:59 +0000 (UTC) From: David Howells To: Christian Brauner , Steve French , Matthew Wilcox Cc: David Howells , Jeff Layton , Gao Xiang , Dominique Martinet , Marc Dionne , Paulo Alcantara , Shyam Prasad N , Tom Talpey , Eric Van Hensbergen , Ilya Dryomov , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 12/32] afs: Fix EEXIST error returned from afs_rmdir() to be ENOTEMPTY Date: Mon, 16 Dec 2024 20:41:02 +0000 Message-ID: <20241216204124.3752367-13-dhowells@redhat.com> In-Reply-To: <20241216204124.3752367-1-dhowells@redhat.com> References: <20241216204124.3752367-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: F36121C0003 X-Stat-Signature: mgdetb5qg48dawkobjmbfpmohayu6uhn X-Rspam-User: X-HE-Tag: 1734381761-742511 X-HE-Meta: U2FsdGVkX198zqgn35AczXTIwH1/eU3thbJSd6IJEB6khHwA4vtRucUOxLAfKNa6Z4KhtGxWCr2fsaZAOasp4o66QkCMuAVrkOBmzb8Iy7GTykVhLQWqOFZw0p0jfsYBKJrXTfzD5Labm31wfQNmO+xleB3180XEhoFAPIBAIOghfJ7Q9UMbdO74KXS6AoH8Bgi4fKyBYzFGoqsrgicR0FhRQvqsbNsKsGGG9rh1OIFm2ix1hHMwJ3M3CVOx7CLwjrS1Fvxt4mB3ZV609hwWF4pbxWIOVJ+wtV7AkcTMB30S+ezCtPDcMNm24mf8AyQowUVg3Y89yNJ1IdzNMi00TdU+7J3WVJR0rplqQB5ve0CqBIkdc5dzuI81YfDlXXqmQa20AJaWI7g52uO6szUgsYkJddIQTyo9d1SYjxz43BYJIrL+1qbwH3rcz5VwWUTqpuI9nuYgDy7KftjlH0FYGWbcoIk5bAmymlxFGtMrbhlO6YkENd3wRc8Sn5brDYqH/2+o+X3o0tSxO7YDx3Yju7cLNcLeGxZYuItqc9X/w3P0PlgdhirP1iCz0Yed94iVprJ7R8Y7acXs8xOYryU9FNutlSX/IwvFu51afKTdx64ZdjCsnTzD6WTsQ4pQbnVcK82VUlH2Hw66s++FRITYXXCbtHL+qkfhUVYVmmpq8calrQj6U887VsY3H9i5DYBhGIH6iSIw7mC0E5pZAhRIZ/XyjZql9TLxW1tHZMV9RukhC0jcpD8GT/eQZ7fAi7X+juonO2pFoVvyPTSAT+Aw+NNiFGXNF1rNhdpHwN/2U9U/M7UmM8ltqKQN3kB8wK3k/HDLUSoet05Xm89TG+zVZQDKBARpv0oS1QhchnjaB/+H/Vzm+IakEdnIYEpC9YLQBqRre0EN8peLhcTCtIN4m/LreyOfl0Ezj/isf+VTOCz1cywXSQ6AH/kvyQ0B1NkRDjNFrmaHTS5qnpQZyCQ lC+ooLtE QMingkCal4YE57un5OoGp09s9IbK2SmHuqCwkVenfcLm7tSopSckKPhxieVNPprHvCknerBmfwAqfXZppKaJLkrh8Pmx2E4S4OLmcJEdKsVLwcoC4LG+wpWIGY7vdMuNzaLfssvPtAyir8vhVeg9H9NeUx8wNDFN4mCY97pqd+h2UBfh3c/8v7+GOUktZeC0u554h+JK6D75nsMigzs79wJc5zZVO9x/8QY/JR1w/SJ74dl92gomS/THoavNG2DoOV+T5vm4h6UMjpIf8ZRwP6eMB7k7opCT44G3tFroW7W+EF23SAjF1ysBF0YC/Ta8ehnBczZkeENqfB+SFZK0r6ZZdq2bCTqhLsHYTvctJZvLvl2VHJ0RnaDh558ki43g24jXHRaEhd/gkN1dSM30aIpRp02USdE5pXdEcJlfgE4txbxUubTIH8UA6Mdaecsz67jlDuq6jOC/HE3kHoxE+VsqA0En7J8DoH6A8P3snRQOfrcq7WZ0oHmrSODSoM+u9BctMutVWB2zwyc4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: AFS servers pass back a code indicating EEXIST when they're asked to remove a directory that is not empty rather than ENOTEMPTY because not all the systems that an AFS server can run on have the latter error available and AFS preexisted the addition of that error in general. Fix afs_rmdir() to translate EEXIST to ENOTEMPTY. Fixes: 260a980317da ("[AFS]: Add "directory write" support.") Signed-off-by: David Howells cc: Marc Dionne cc: linux-afs@lists.infradead.org --- fs/afs/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index ada363af5aab..50edd1cae28a 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -1472,7 +1472,12 @@ static int afs_rmdir(struct inode *dir, struct dentry *dentry) op->file[1].vnode = vnode; } - return afs_do_sync_operation(op); + ret = afs_do_sync_operation(op); + + /* Not all systems that can host afs servers have ENOTEMPTY. */ + if (ret == -EEXIST) + ret = -ENOTEMPTY; + return ret; error: return afs_put_operation(op);