Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp175884lqd; Tue, 23 Apr 2024 20:41:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW8JczeGyGBWXtoJi7YGZyq5LYNGTuD0ir3DyXlKY/F1xevDOAObT+GNw8xYyOaY5zriZQIATdBbAiLa3m2G/QEUWvu2/2brPzyrR0o+w== X-Google-Smtp-Source: AGHT+IHvSpKkFSSYvhMIJ5mksshR04iuq84yPHIWGEwwX984NH7gT6PV85qAop2FbMTyckkYYWPA X-Received: by 2002:a05:6359:ba3:b0:18d:8cdd:44ae with SMTP id gf35-20020a0563590ba300b0018d8cdd44aemr766071rwb.1.1713930090869; Tue, 23 Apr 2024 20:41:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713930090; cv=pass; d=google.com; s=arc-20160816; b=e7shyhUhb00PFoyuAdPexzcFXqOE4QbdUQdkhtI86RJbF4ArgJmFaBSoIdqjLFUdOj 3Z08fzYsaXkGt4O3Ftw3AZWYqqM+8LurJF7OcMtXVdGx4fSXkED11xLAyTUXwF88BDc0 oVMdSu2C/wDI1aohdUuRomWgnveumb6iDc+EWUWN3lEUPbXir9zug2nbiDwVnL04Un8I plN7vhdm8V2VwyvFi3kOwIMnRXvYZFqS6y+vK8R+ed2+V/VkOkP2mYIfKWsIAKKQ9Szy b/KG3HC5x8RT0llGWSp9WoF51u0gSqR/DtmcXpQ0RZXuLnEX7JvMHX4vcYg6I2qHt2kO z3OQ== 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=3CsaseL1DGH+EMXcTH0kn5GO4vnHCl+kF9eyofb3vLk=; b=Jx0jmWRjRmQbJy8UzMR/qRgDlOr6Y2xS80wkDIu7scGU5aCE9M28sv5Hxens9anKWl GXmji/A5DRgKUQmyyMslWBzz6dZII2G8aaKCv96NHRQuvDclRvdppn/GOwDGQFA9eHoU QHV25XWwukevtlWibY01qicOXJD6d1R13TOdJmdn+NcUbLdDKG4RNDniwap2SN/ju1Hk ltTkryLpLybEPQQfBttWciT16mxWlER/y796k02P2X4SIzXa7twf9S2VcHfOPqgqnvLF BhDswECjkGDCfFGFUtH5bLlnBg5KF68+HYQ6Qcw8KcqSmoo8iAUMMmlIMKUkx6CjrkVw lphQ==; 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-156221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156221-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z6-20020a63e546000000b005dc8719cdfasi10501279pgj.298.2024.04.23.20.41.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 20:41:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-156221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156221-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B2CA8B2256F for ; Wed, 24 Apr 2024 03:38:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC1A8145321; Wed, 24 Apr 2024 03:36:56 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (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 3B53613B583; Wed, 24 Apr 2024 03:36:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713929816; cv=none; b=hT5+dxINgQArWL1IZuKTPC5yyUx4nDSSFT8Dy2Yu3D7Y2KPh8oObtHmpuqlDpH159+KCDQ0BpkwOewsCr/77nYH4qCiwcWyU+jP1BIEil5/691vQzQrDArrnTbb+PJGAga4wq6MM/HrcNQlXgY78mVFTgi/YDZbiWmz0dOXEnSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713929816; c=relaxed/simple; bh=eYmI2UoND9NW9g+AeXxMK4ItoLkzH/5fFHbVVsjmXDU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iFBBgPQxjSa/ZGDFsDeBbMZ0t0X1Qhc+thtWdEdZerf3rYg72nhLGahLVpPksscMTyrxBWEjkzYUsggO0tzHIXaY/z0u72o5SgqJ8L5vOEsvwAiXXt2xOjCHt8EGauBGz8xiDMUFZdJcThl6uFRFOW1Q96hiWYOof9uMSUJ1qTE= 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.51 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.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VPPmY3w9Jz4f3l8D; Wed, 24 Apr 2024 11:36:45 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 62AC71A0568; Wed, 24 Apr 2024 11:36:50 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgBHZQ5Nfihmarc3Kw--.25590S9; Wed, 24 Apr 2024 11:36:50 +0800 (CST) From: libaokun@huaweicloud.com To: netfs@lists.linux.dev Cc: dhowells@redhat.com, jlayton@kernel.org, linux-cachefs@redhat.com, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, libaokun@huaweicloud.com, Baokun Li Subject: [PATCH 5/5] cachefiles: correct the return value of cachefiles_check_auxdata() Date: Wed, 24 Apr 2024 11:27:32 +0800 Message-Id: <20240424032732.2711487-6-libaokun@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240424032732.2711487-1-libaokun@huaweicloud.com> References: <20240424032732.2711487-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:cCh0CgBHZQ5Nfihmarc3Kw--.25590S9 X-Coremail-Antispam: 1UD129KBjvdXoW7JFykurWUAF4kCF4DAr4xWFg_yoWfKFX_uF Z7Ar4xXr4fGr4kJwsrA3y2qrWvqr1xAwn8Kr1Fgry2yw1aqFZ8XFWDtr98Ar1UWr4UK3WD trZ7ZF13WF9FgjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbPAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6r1F6r1fM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr 1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0D M2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjx v20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1l F7xvr2IYc2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxan2 IY04v7M4kE6xkIj40Ew7xC0wCY1x0264kExVAvwVAq07x20xyl42xK82IYc2Ij64vIr41l 4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67 AKxVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8I cVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAIw20EY4 v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AK xVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUUpVbPUUUUU== 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