From patchwork Tue Feb 6 15:17:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Jackson via B4 Relay X-Patchwork-Id: 197515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1622373dyb; Tue, 6 Feb 2024 07:35:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgGa9VRCwT/jatS1epNIvRP5VnKjU4SUMH0iUlPH8Is5dvwhmGwQKN5zzmMDURlWNmRWCW X-Received: by 2002:a05:6a00:929b:b0:6e0:527f:fe6e with SMTP id jw27-20020a056a00929b00b006e0527ffe6emr3713002pfb.0.1707233719446; Tue, 06 Feb 2024 07:35:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707233719; cv=pass; d=google.com; s=arc-20160816; b=rFlcpFOTBbOmKCfpZ2HH74yJg5o1SWtKMb/qbelFTjVNEwCkSPhIklFa1XFnVfEiY3 /3wrEzIJt3Q80kZNGgeJge5Bg6daVsWvnZTDo3Goj7TFRgteKJAfrUsyFXNWkc2EcELy SI2qh16ATM4bniTspUbcEvmXmK3gr6n6Ue25SnQC9BDeAZshQqsOCogy1xhCaZzU56l3 /calAMMuSS356zEbxL68XZXaShkOUFfADi8zyEnLHtEw2HSKrdLUScACk9b517YBVzg+ 8vP2XqjfJgYC5q3vugdceBeb8JyOqjPyV/b7LevMnJkXTYMhC34hFUuh9zl6XX+IEImV abzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=afbA+Lh2DSfanL3ST2dKzgdRLotQajSmqXzgYC2BgIg=; fh=mqWxSoG55EgfUFjjU6nOe+SAJzE2KstsMuKMhWzk9Do=; b=IGlO3db6PVgyv97jQEITvPCQQnIZmUUY6ptbmR46tQpNB/9765GUL9JQzwDnooAhkZ 1ZO56UZ64DmsUZY8YBI7GbwvQMl6RDPNOSBz8dY7lM9EUN8FG3TDvRGefteaKS9u7pny DZE7yGznN6i2cIjmSlzpQOwl9T+zsljyDZiDyZvHJj8Bw1MehJsn/K8DKYwuoQ9sBRCZ fEDKaIDABQsBZNj7J8Qk7bA8uHkjPSF8gpvo9ePCjK/Y1EXLU1w+Qw/3cHGvW4NPdNiV eBbSnxXnu3NhPzhq2B677OcrO+Q2wjFo4ND06GyEtwpiGmSTJrDVS8bq6aZm8TnDbaLb arTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TegT1xea; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55226-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55226-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWJGewgUKSZVGGhigT8xJah0q/g6B99weetL5FWYfBxYgsfGLya6nTP+IT+S3W2ZjMUeaVs/hdKXxmJ7T74GvOKUqnTSg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id t11-20020a62d14b000000b006de05b4285asi1742085pfl.117.2024.02.06.07.35.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:35:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55226-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TegT1xea; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55226-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55226-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 534A528D5F9 for ; Tue, 6 Feb 2024 15:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6C95136980; Tue, 6 Feb 2024 15:18:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TegT1xea" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F769133983; Tue, 6 Feb 2024 15:18:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232702; cv=none; b=OL01cOBTrsDHVV8dExnP/99rGpgQve40YBj6oD5BeiRQc3X7SogFIc66PbTHo7XLCu52Z6fZJf1eDhW6NhuHaxdjAXKmJL0/AyDcRcc/tbIzWJDXxr54d8yhPsc+2e39ShWDapFCJgvewFAbUsMWZJyA5ZJD7FaEBQdXZyZEs3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232702; c=relaxed/simple; bh=VdU1vYi+GD+ERYjNJIkCxt562Lr/u19Pv+1odKYSw10=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=ra5xFmEVh040Mc1HkkKnLWyjTIA3PAoWcPbMC4dMzFG+apT2ZvCMvt2+zyNTpAPVatTHYamfnhgiuZUI5AP/XDMI4gVmofmV3nguhCmljAeG24AurMuUVBFfkeUnGnLbDZE2JuG27z6E3XyrGwdRah2HOM7DfEZU8n/u7EATc68= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TegT1xea; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 937D8C433F1; Tue, 6 Feb 2024 15:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707232701; bh=VdU1vYi+GD+ERYjNJIkCxt562Lr/u19Pv+1odKYSw10=; h=From:Date:Subject:To:Cc:Reply-To:From; b=TegT1xeaUHN+4H5ISFusXR6gs17vmhyBe3O2IyOYGja9hciFg//jH6BtC8LEg9wp6 5z/70zbK4mxfzg4eoiXR3eseLqAUzoMXZLdtfgA1Sgb1CCn4DvKMf945u0FLQvc/Xc +eYFRcsU3nkJ1o8W8qORVjDT18ADWtNMxubWKUeqSCmfCLXyB8jc830KMCNVWT7Zrw 0PhdLQ1XdxiO9WZNpd/LxRYH+btZq+o9KcUw0VKP9gEdzPPKKedD3GImrSC0uZ4MnD y2hLvQJQRPNOUtGTFMpCIxqrxA820OK8lPG/J9BDFrHIqhjwyH1i/maOb/Aah0bcsR LEm2qeLOIbZXg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7203AC4829B; Tue, 6 Feb 2024 15:18:21 +0000 (UTC) From: Taylor Jackson via B4 Relay Date: Tue, 06 Feb 2024 15:17:52 +0000 Subject: [PATCH] fs/mnt_idmapping.c: Return -EINVAL when no map is written Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240206-mnt-idmap-inval-v1-1-68bfabb97533@me.com> X-B4-Tracking: v=1; b=H4sIAJ9NwmUC/x2MWwqAIBAAryL7neCjIrpK9CG51kKaaEgQ3j3pc wZmXsiYCDPM7IWEhTJdoYHsGGyHCTtyso1BCdULJUbuw92UN5FTKObkcrLa6MFN2lloVUzo6Pm Py1rrBxyJvE5hAAAA To: Alexander Viro , Christian Brauner , Jan Kara , Seth Forshee Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Taylor Jackson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707232700; l=891; i=taylor.a.jackson@me.com; s=20240206; h=from:subject:message-id; bh=2l2Nt8j5OYHJJurGGPNUw+7blMKm2R2dG9Yx/CViUyI=; b=KmXGWKD8500obyfmmDYWwluHofdz3w2KdArnaAT553VlbvcAPHEfkuirTLne5vUdfSQ0ybnv2 5NsuDm3y269DxhGLXuFEhejM8RpOD4hmSb8MQKXBpti7AhwVCzH3aIW X-Developer-Key: i=taylor.a.jackson@me.com; a=ed25519; pk=NO7ntQpjIG1IGTO7F8OnLJDKSHUakhrhAli+PL72OLA= X-Endpoint-Received: by B4 Relay for taylor.a.jackson@me.com/20240206 with auth_id=127 X-Original-From: Taylor Jackson Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790164304932413293 X-GMAIL-MSGID: 1790164304932413293 From: Taylor Jackson This change will return an "invalid argument" error code when a map is not provided when attempting to remap files using the id mapped mount command, rather than returning nothing. Signed-off-by: Taylor Jackson Reviewed-by: Christian Brauner --- fs/mnt_idmapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 54be6c6c5ae8e0d93a6c4641cb7528eb0b6ba478 change-id: 20240206-mnt-idmap-inval-18d3a35f83fd Best regards, diff --git a/fs/mnt_idmapping.c b/fs/mnt_idmapping.c index 64c5205e2b5e..3c60f1eaca61 100644 --- a/fs/mnt_idmapping.c +++ b/fs/mnt_idmapping.c @@ -214,7 +214,7 @@ static int copy_mnt_idmap(struct uid_gid_map *map_from, * anything at all. */ if (nr_extents == 0) - return 0; + return -EINVAL; /* * Here we know that nr_extents is greater than zero which means