From patchwork Tue Jul 4 07:40:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Ming X-Patchwork-Id: 13300729 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADFB9EB64D9 for ; Tue, 4 Jul 2023 07:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbjGDHlx (ORCPT ); Tue, 4 Jul 2023 03:41:53 -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 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: fXvQa1A9O9iBkD0DO76lytUwAlD6+LmSLkDSjjTV6x50IQLzyi5LKJiyt/KUaobrXPgi3NPOcPF9rsNWwF3afW+B4vVs9Zyh4oUX3m0yJ1zCQ3NT62bvAuZYfl17K6rS9Ef6Jhg7r5euDHhR7V0exQLwgXTC/jKevYNOlzQgUfsbv0gvGzN94frN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Yk+Ifg7OH2owKRK5mvQbmpSHbixGEM85ab7A7zfVDoddICK9w1mQihI8joz5yQNuHwbrsYThHI1wTmLgYPhVw28EOxg3VXxD4FvXKDxz3WcfA0UlX3CdGc4KikrbYo5UEknatp7Pf4UeJSH0r60bUdQjSJc+88MyXzwX9EcIsisBIZKUYW2D3Vzc+lL18H6KOgT9D9oNBxhL0gNhV+ywaw3gOtw+AunpWMUWEGtJ5k63h4q5vKcPqEaQUnH4PXXNHvTMrmSNwRhoE06bAuDMDA7+KdKgDizKIm+9+GEsW35bI3fZ6iPmISruikGMRl6v/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 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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 Acked-by: Namjae Jeon --- 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; }