Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp108751lqp; Tue, 21 May 2024 21:07:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzV1jqThLXUDsEXCPsjcZOLl0jyIxonkld00rPv2IUKcR4whxcNbBmrZXJ7aiMUOTH5RHUlOg+aqVLCqshQUh2OwN4EPJX2keTBrznRQ== X-Google-Smtp-Source: AGHT+IGZBEP9NCn7V9TD1oEqCLfsSsQDiUs8mGhdtRARxK81Fa4aJQcWqDYypPTZG54Fb0iMqsyr X-Received: by 2002:a05:6a21:3d85:b0:1af:a4f7:cba1 with SMTP id adf61e73a8af0-1b1f8a07098mr819882637.31.1716350838517; Tue, 21 May 2024 21:07:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716350838; cv=pass; d=google.com; s=arc-20160816; b=Qa2b3HY0xl4+hhAZmu7ALq0rgZ4xMmC4bwgSoQRP0xg0igmnh8bw5j/jLrBSKG814U Z6j9GXFxkDu8YoVR2jnfOtKhpXfh78LJHHRC5z3UinHTEsK7kfvifUa5cTAFAsdxM8Yk lDW/no+MVnKg2GnNFCSNXUmlhQT94wxA1jHvwlnZVL0A4br4vVLtx09RVIwzsb0QiC12 xhiGVf6wrwD+0lUSozDlGir58DcHaNOA3m7SZ7IATLbMP04if/HYxc92ZrDB0ssVg9RT Xiu1agOZipi+PjwrknGHN9/w2zSuoN/9Dvw/PpaebWV7jYM3CV1C7/jYr1YSIowntBcn +gjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=D+ZZbNlKW8rU71LkMq9nuzLvth0nSC4ZR9o9yYKqn08=; fh=dfpuzL54LAMf7GQmHoqmub+qZCPWKUPNTVFHnj8Vxqk=; b=aX84qChmmFIqo8EpN1OEP3GycGd8EydS4wXw8wq7B2fcAaZsgwljOoMfD/XFZ9xXYi 5dLlJkQK1GbDRgzFGdFnji6i1Q/04OR5k3Xz3CR8qwU/jIC9IruvfDj8Rg1d97hc7aol d9y6QJnov/yzAq9qgCDcncSolP/2mX0PI0CMhm6+bnhhagh/P1PYRSXIGLleQJNuQSlI G8eV35c/mFO5UIFH6/V8Vaf7NZE2l8Vav5dyDztzlGTpvzpVu+9ouE07TAQDvI9yTlz/ WoAk1xTE0yBRHSiovfyneFN3IV5bB/U5KOk3RzcI8IvokXM9o0sGO1uihP7n0UhXaJBF ZDBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-185754-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185754-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b6290ce770si27263710a91.167.2024.05.21.21.07.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 21:07:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185754-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-185754-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185754-linux.lists.archive=gmail.com@vger.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 224E4282543 for ; Wed, 22 May 2024 04:07:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 60B7F7D096; Wed, 22 May 2024 04:06:05 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (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 713D637144; Wed, 22 May 2024 04:06:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716350763; cv=none; b=tyZBvUmfGrdmnnb9hAYMZNY6agzJT6fq4cnNC+Nty0DIFiHBMZ33sDcHxtU+uJ7MbGCXjPqnee8KlGnabIdEv3BnrPSJJ/Dmq8fsKjrDS55i0MrUmmLFQdx8kMeHNp1pwwcOT0TfTItpo4FfFpwLrF+3JflYsW0CZhq1gYmro3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716350763; c=relaxed/simple; bh=eYmI2UoND9NW9g+AeXxMK4ItoLkzH/5fFHbVVsjmXDU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=thmga0iNjnzVyxi1WF3Eb/YEQD1dc4dGnh/IWiI5g/To+pLDeiTp1MmxXgLXXyi2B+Ni9FwFZphD7KMAwqjIJ1aMX+Ri8RJrviWjkc1ChK4PK2WM9lR7kPybw/PNb9Gs8erZKjg9m4xHCOTt57DEI41tqoUMuvVM/2Dp1OUuNHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Vkd5B4Ggqz4f3jdN; Wed, 22 May 2024 12:05:50 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 877851A04C2; Wed, 22 May 2024 12:05:59 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgBHZQ4ib01ms1VYNQ--.24441S9; Wed, 22 May 2024 12:05:59 +0800 (CST) From: libaokun@huaweicloud.com To: netfs@lists.linux.dev, dhowells@redhat.com, jlayton@kernel.org Cc: hsiangkao@linux.alibaba.com, jefflexu@linux.alibaba.com, zhujia.zj@bytedance.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, libaokun@huaweicloud.com, yangerkun@huawei.com, houtao1@huawei.com, yukuai3@huawei.com, wozizhi@huawei.com, Baokun Li Subject: [PATCH RESEND 5/5] cachefiles: correct the return value of cachefiles_check_auxdata() Date: Wed, 22 May 2024 19:59:11 +0800 Message-Id: <20240522115911.2403021-6-libaokun@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240522115911.2403021-1-libaokun@huaweicloud.com> References: <20240522115911.2403021-1-libaokun@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgBHZQ4ib01ms1VYNQ--.24441S9 X-Coremail-Antispam: 1UD129KBjvdXoW7JFykurWUAF4kCF4DAr4xWFg_yoWfKFX_uF Z7Ar4xXr4fGr4kJwsrA3y2qrWvqr1xAwn8Kr1Fgry2yw1aqFZ8XFWDtr98Ar1UWr4UK3WD trZ7ZF13WF9FgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbmkFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M280x2IEY4vEnII2IxkI6r1a6r45M28IrcIa0xkI8V A2jI8067AKxVWUAVCq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJ M28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2I x0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK 6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4 xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8 JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20V AGYxC7M4IIrI8v6xkF7I0E8cxan2IY04v7M4kE6xkIj40Ew7xC0wCF04k20xvY0x0EwIxG rwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4 vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IY x2IY67AKxVWUCVW8JwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Cr0_Gr1UMIIF0xvE42xK8V AvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E 14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43ZEXa7sREMKZDUUUUU== X-CM-SenderInfo: 5olet0hnxqqx5xdzvxpfor3voofrz/ From: Baokun Li Pass the error code to ret when xlen < 0 to avoid misleading the caller. Fixes: 72b957856b0c ("cachefiles: Implement metadata/coherency data storage in xattrs") Signed-off-by: Baokun Li --- fs/cachefiles/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/cachefiles/xattr.c b/fs/cachefiles/xattr.c index 20e4a4391090..4dd8a993c60a 100644 --- a/fs/cachefiles/xattr.c +++ b/fs/cachefiles/xattr.c @@ -110,9 +110,11 @@ int cachefiles_check_auxdata(struct cachefiles_object *object, struct file *file if (xlen == 0) xlen = vfs_getxattr(&nop_mnt_idmap, dentry, cachefiles_xattr_cache, buf, tlen); if (xlen != tlen) { - if (xlen < 0) + if (xlen < 0) { + ret = xlen; trace_cachefiles_vfs_error(object, file_inode(file), xlen, cachefiles_trace_getxattr_error); + } if (xlen == -EIO) cachefiles_io_error_obj( object, -- 2.39.2