Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp27305284rwd; Tue, 4 Jul 2023 00:46:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlFtKUXK4Q1QlLakQkOpI4yw5FowOPqUSzqiLWae6g5fMG5iHhpSrDeUXsjgp2zy6DssWdog X-Received: by 2002:a17:90b:30c3:b0:262:df79:6f81 with SMTP id hi3-20020a17090b30c300b00262df796f81mr9658174pjb.24.1688456770710; Tue, 04 Jul 2023 00:46:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688456770; cv=pass; d=google.com; s=arc-20160816; b=exPp62vaxyOL8l2atChB2OeCNvYf1nHuUvRhp7F9LhcLuhCyuZVUksqdQXivLO/Skl 5wVwx3Fb6FiEQwRYqVefVKAlgQVLfJDYAsgLZM3wLpqRSVxBAxR5ZTPGkwwnPmrXH6I8 gDJhnStc5xjddMnTjjFiOjU064L3KX7RRB3dc08rL+Ygt4Uo/A/K2PkAXvJbnxOmZ61F mo8wLusC2nbRDft13CKOT1hZixMDD1HuIUKKOSusBviviczE7FJBpYR1UmTxcdZEsVp8 fxvh89olW5P6S/97Wx91sMnai3FDKWYWKisBnNp3w48tbfpwbBoyUz6lT5aLK0npJKvS Dhhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=OmwAn81Fi2V/5BSOKwBsKaM6gkV9mnrEsUDf7Vnot+k=; fh=DIFhynbWXk7hioseMdWkzFOzRAhz+IRhO9Uy54Zdde0=; b=0vZewz3UVGKCdQbquBcQ5i8DLD86ZIVFOWrnED2GM7XPwZEsrbb2FKqVtGfaTrYAR3 3itymUKemuPwRhwH9nKRYN97TbFBjBKBiBUwYzMxeSxqzNqdlaeo/UBLTiiAhcVHLkbV kQkeXGRpVniuiNsR4CbONd6AsURPbCV6+bEyxe0Lhawp+oNkZC7+ckzj1BYbbXSkNt1j gmdZw3Mm+NzbUIq7ACPzqO7xbP5Z5QrUp+xPu8oOPgXhcT6dW5F8vvjoVfogyx7iFkMu G1M6Q+8t/0JOr4K1LD7WKypTWkMcGuRJjaA8IYi30Lhhp1IVI9+YsC9c4e93zrzhIdS9 SAfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=KpjpnmwU; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a17090a4c8500b002612b8cd1dcsi22178893pjh.162.2023.07.04.00.45.57; Tue, 04 Jul 2023 00:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vivo.com header.s=selector2 header.b=KpjpnmwU; arc=pass (i=1 spf=pass spfdomain=vivo.com dkim=pass dkdomain=vivo.com dmarc=pass fromdomain=vivo.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=vivo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjGDHly (ORCPT + 99 others); Tue, 4 Jul 2023 03:41:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjGDHlx (ORCPT ); Tue, 4 Jul 2023 03:41:53 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2115.outbound.protection.outlook.com [40.107.255.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07F10BB; Tue, 4 Jul 2023 00:41:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JPuahvjUuR6gKMc2q/t+QjtwQ9KfNImPimh2W7/unIPfqnBUTxCIjKzOBC9xpjLOA4eEEtu2gDrcJO+10LU0OZ82isWDfTXChgK4zvu/TAncxyvH/4PovZj6h0vemVvDW+NyeUmYmueBkf9qrfCiGRsfBbUjeDPfB2ZUiKkegawcll0SyKMQTIiHEMYywK1hRVhT9XDXzt8bfYtMR2q6DpauC3Z/bh+jjzp2yp8cJI0nGruJ7cVMmbsAla+tzEDe1mwkO5B+al2B5xKCoSZ4bv3R4Ko2BDLGSHeYrvvmfivmYBS2N1p7CV74NbNUABJNTRdvbLHHIzoVmSk9xNfKGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OmwAn81Fi2V/5BSOKwBsKaM6gkV9mnrEsUDf7Vnot+k=; b=Z7x6SSlA4iOrrBy9iRq/Me/2Z5zcQOOH9GMpeAAZzbU/JplCvUKpJkvg89csFrdsp1ajkWn1tLz88nFvO3p49vR8Bs+dJ63CKemdqxlinlpBPQRvCLOVoz9RaG6U4vV7HSn4vokGkXGbk1KDjrCLh3I1O0s81UOYIa0EIDodzboKlhj5hV47hj3/vAo4hv+7KUNpLUT/EC+2qW3Il1/lxFg8Di862XZ9hop4EPA++WNvrJeugoilZFg0fd0h8zlQ+LYQOkUhgCS89R7jnZ11PCHQDJAXI7JnY5TZnbRL3T18sIGbt6qfcXnSWrI17A0wuj+wJXqT0ti3wZisSxB5WQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OmwAn81Fi2V/5BSOKwBsKaM6gkV9mnrEsUDf7Vnot+k=; b=KpjpnmwUJ6E68aMGBiytNy+0/iafAOwnNz+or/FRWc2gQnCSKAjjrTxoleIB2eMLt4kMW41cKZPkWn5V7O6o8KyQeTDyWz1ZT6QqwJCHWCpC/X8nqdjnvOHWCGo4psYl0c9rJuw8CLnpxAQ92A9PU999BYBSeIPx74bZhumxwq/661xM9iy1ROcDAv9uU89U3AxlWx9eioAr3jlcf3qFLuA7pYp8SDYYwBUFmkx+gRM0DHnbEUU3Uj2fHcCWJ2S3Q2hgei0uBbXLK9HduWEVT9Zl0Yy25Ha5WWp5iKMIcHVbfDLuC2C31hvGNhjd0fEPi2hcSUvtw1rp26kGY02U3A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SG2PR06MB3743.apcprd06.prod.outlook.com (2603:1096:4:d0::18) by PSAPR06MB4198.apcprd06.prod.outlook.com (2603:1096:301:3e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Tue, 4 Jul 2023 07:41:48 +0000 Received: from SG2PR06MB3743.apcprd06.prod.outlook.com ([fe80::7dfd:a3ed:33ca:9cc8]) by SG2PR06MB3743.apcprd06.prod.outlook.com ([fe80::7dfd:a3ed:33ca:9cc8%6]) with mapi id 15.20.6544.024; Tue, 4 Jul 2023 07:41:48 +0000 From: Wang Ming To: Namjae Jeon , Steve French , Sergey Senozhatsky , Tom Talpey , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Wang Ming Subject: [PATCH v1] fs:smb:Fix unsigned expression compared with zero Date: Tue, 4 Jul 2023 15:40:47 +0800 Message-Id: <20230704074057.1162-1-machel@vivo.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYAPR01CA0098.jpnprd01.prod.outlook.com (2603:1096:404:2a::14) To SG2PR06MB3743.apcprd06.prod.outlook.com (2603:1096:4:d0::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB3743:EE_|PSAPR06MB4198:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cdb4c53-b972-4834-85bf-08db7c621f12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7Zop6I6QgOxnr7xEYYMPFW2NSDJUFjVl3b6MdtozPr/kg274gY+9L39nV2pd23f7gFxBZR1aKYYa93J6iCsrcJ7r1l76sh8RAleo2p56kQr+MYfZ5eJaUOhuTHiqVF+Ffg+VcB08UkwX2cDdrCFogddlec8NlDSsPjlkoZd9NO27qPY0sDIgzt/OH3JbvcIMlFLViceX/iaYlUnPDYkSwkpUHMtPwl3kYOF0s+SodxALaXXVEf4Hprrf4kOQU+/KE2T3oKJdfu4f8L/MURP0dg5NRpy4gwcuhpsNKB3AOqsWIab6qW7J0LroVgJfG9A6Fkm2LuvFYJjfp9gHiqNyhzkKf7C5S1tUeZlC8OrwHyMNV/8USAg2FkarR5A0YaB5MJWstRoy6B677jU5PPitr8R2VhhGs6tIyAN3qQB71SELWnkXcaIGhQPBwlpguReQrV0dwSGhYLrC4Hf1APf8cfQj3zAOUyZsPn/HB2NYqWyM7v6vdK7XVOlMzbG4F8/r5qo4GgTMf87u67sos6OJlv2hPsexcfNLMtThTaCx/djVhlbSU8VeaiJsYb+9ctRsdXb1wDwZip04kQerw2If9sszP7BYoHtL+oSPHVEU/9gTIOpx7mTpNkkJnwoJKa8V X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SG2PR06MB3743.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39850400004)(136003)(346002)(396003)(366004)(376002)(451199021)(1076003)(6506007)(6512007)(38100700002)(316002)(4326008)(38350700002)(66946007)(66476007)(66556008)(107886003)(2616005)(83380400001)(186003)(26005)(478600001)(110136005)(2906002)(8936002)(8676002)(52116002)(36756003)(5660300002)(86362001)(6486002)(41300700001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fXvQa1A9O9iBkD0DO76lytUwAlD6+LmSLkDSjjTV6x50IQLzyi5LKJiyt/KU?= =?us-ascii?Q?aobrXPgi3NPOcPF9rsNWwF3afW+B4vVs9Zyh4oUX3m0yJ1zCQ3NT62bvAuZY?= =?us-ascii?Q?fl17K6rS9Ef6Jhg7r5euDHhR7V0exQLwgXTC/jKevYNOlzQgUfsbv0gvGzN9?= =?us-ascii?Q?4frNSiT1sRkztnL39/cFmye6jIqPKqYTC3HAH08pCuf+n9hb+l9D+n9+I6F0?= =?us-ascii?Q?C5PbmP/zyMwDiArSjJBIBR5PP7HOTJ6RgLgZD14QdtN36A3slX+uq0maIUm6?= =?us-ascii?Q?MyK5sGlIQC0A3Ouyot2bM7o0KM946p4jcMhw8R6JA1lYqbYtzDAoNXv79GsA?= =?us-ascii?Q?+RoolkfKcopWLp6xkqbP/cS9awI6piQpSTuiBm++iOYGf8VVGtaoGELWz4qo?= =?us-ascii?Q?1BCZE3sq2qEmXnnOr8awfxFewROliSjnTn/XnfgHF4SODUGJNqoX8C7dUP9A?= =?us-ascii?Q?z3Ofa6sTaUNI23SLOjN2D6OxrbY1bK9J4T48aD6SC9U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bYo5UEknatp7Pf4UeJSH0r60bUdQjSJc+88MyXzwX9EcIsisBIZKU?= =?us-ascii?Q?YW2D3Vzc+lL18H6KOgT9D9oNBxhL0gNhV+ywaw3gOtw+AunpWMUWEGtJ5k63?= =?us-ascii?Q?h4q5vKcPqEaQUnH4PXXNHvTMrmSNwRhoE06bAuDMDA7+KdKgDizKIm+9+GEs?= =?us-ascii?Q?W35bI3fZ6iPmISruikGMRl6v/NrcX1CTinZFXCNb?= X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cdb4c53-b972-4834-85bf-08db7c621f12 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3743.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2023 07:41:47.8405 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Qy7b4MTUgGLvXFTBs64WJtW+HHS2i8ehIhD7uk+h4uk4zZWMeJpYNwNlYnwDDbsGTuOQAUQuO2E09xfiyamteQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PSAPR06MB4198 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of the ksmbd_vfs_getcasexattr() is signed. However, the return value is being assigned to an unsigned variable and subsequently recasted, causing warnings. Use a signed type. Signed-off-by: Wang Ming --- fs/smb/server/vfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index e35914457..e605ee96b 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -412,7 +412,8 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos, { char *stream_buf = NULL, *wbuf; struct mnt_idmap *idmap = file_mnt_idmap(fp->filp); - size_t size, v_len; + size_t size; + ssize_t v_len; int err = 0; ksmbd_debug(VFS, "write stream data pos : %llu, count : %zd\n", @@ -429,9 +430,9 @@ static int ksmbd_vfs_stream_write(struct ksmbd_file *fp, char *buf, loff_t *pos, fp->stream.name, fp->stream.size, &stream_buf); - if ((int)v_len < 0) { + if (v_len < 0) { pr_err("not found stream in xattr : %zd\n", v_len); - err = (int)v_len; + err = v_len; goto out; } -- 2.25.1