From patchwork Wed Jun 14 12:27:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Ming X-Patchwork-Id: 13279996 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 398C4EB64D9 for ; Wed, 14 Jun 2023 12:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235818AbjFNMaf (ORCPT ); Wed, 14 Jun 2023 08:30:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236369AbjFNMae (ORCPT ); Wed, 14 Jun 2023 08:30:34 -0400 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20703.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::703]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5E772680; Wed, 14 Jun 2023 05:30:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WDeoHLPUq+gACUyfhOK7YpOcBqQEhQvI0vKknldgLh0qt3JKcq+BQR0Nrqe/fOTrjKsmBd4ztsmcSMhbIlcqEGLI8cxM3etEhqSUGCYX3jmrpD3utvwReqafURH6nyoMZzYmrRLY1kmQ7AStDmK0IJ9OEcuEb1FdFqNqs7Th26xjIdkuAJ21GV6kqtmJZoU6Qk8vL1neVEeiWCBsCYvP1/831zE/Z5N1j4a8xR1Xaj6rIGgz9CCyFF1cXWsayxKEHE++s/ezqWCDIRWy7ZsV6jfz1oe3KAvSI4x8zFqKETZ8hEkl/OuZPyYpOT811FZUE/C5tQuTrNyqOctMhVTo+w== 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=Qf0GbTXvMdgj5kqMqes5fyhHy9P9Q++NswyhnYonv/0=; b=gJqrsb2jKaQbahEffpKI67HtdR05UO2tWgzzNL4EFEMG6wf2VhN3Gh5VjMQEEJfP3Se3yGbRckv8Tq2VqHamp9pLU9sxe0Yc/5pYO/w04WWPWG61dnmlCC463+ECmuMAoBpkGf5WbVGdCzl1uPAGicfWiFNoPhWjeE+nC6FDLDzV8zgAAYwE2QwhnhGHXGInnB1F7cpQOhuYnKRo1jSUC0A9E3KzICGBWwYhip+MvW+7RaWlRNwSRD8hGr6fd8oNNbcV832SBzPxLTOaSB0wIqPsilSta4/YwXs+ioVfBU7f+lOEzA7Zopr3bSvIwSDTDKpHPnVvEv4Xp0rEyWEoaA== 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=Qf0GbTXvMdgj5kqMqes5fyhHy9P9Q++NswyhnYonv/0=; b=qqcKN9mwh02OiOgheinuu53JcMZBSZLqOmI7pcbD511ODxKB7gT5t2yrsC+TgIFb8oE4l4AzPqk5TJFaitFj+p23OWpSjL0Nlw0cf67bB1dzwc/6wyw9tOZZq9+CsDyGlWpZgwK+TR7WHW17TFh3wOIL/kdg7XuBzooyHmk7KUXEm+HJO7hBkGk7tjP8q5Xic1z9jhiN9357Bka6n/++WL/Sf+Exv2z1gVoj1qwXu8CKeWwOkkxNJYs710fBYhh7Yoxtx5ef6+u6T3YTL4m+f/r77WzoBSlJBkG1HdIN7M5IcCYmC162U0R0pAPYyylQDtPCpCLdp6RKLN6oWLJWcg== 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 PUZPR06MB5849.apcprd06.prod.outlook.com (2603:1096:301:fb::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.38; Wed, 14 Jun 2023 12:29:22 +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.6455.045; Wed, 14 Jun 2023 12:29:22 +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:server:Fix unsigned compared with less than zero Date: Wed, 14 Jun 2023 20:27:57 +0800 Message-Id: <20230614122808.1350-1-machel@vivo.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: TYAPR01CA0162.jpnprd01.prod.outlook.com (2603:1096:404:7e::30) To SG2PR06MB3743.apcprd06.prod.outlook.com (2603:1096:4:d0::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SG2PR06MB3743:EE_|PUZPR06MB5849:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b218ec6-9b19-40f0-f2fa-08db6cd2fba0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 01OBd+oQY7pB0z0vgJWYcTjvEq7bQER+k3jvqUbEAJEAG1CpqHaBhFiiFQqsmRnRgU0EQWE/aKRUFHP7JnMjFl5R6Ep9qgM7ayvpkQrdXI5oUraIPHwG0XqhEr3JrmUB03PxkAI5yuImFZcn7YS/QU2KBgsCYlpnueoTG1ydiJ9ybraeHiKbqTud/xZo0PCcFyiNZQ2GZkJmQv3gytR84ZchTKiSNdb6nKvfZJ/MJnQ9pVNoBCSf/CsNorMQbInIVnrgII2EH8p2dky6bu8FxVqCuTEjc2TJl2Mx+Pet2YsrnrbIZgoQ4E9zeskM/s5VWR5rX0xvWp+96BMBx6TOv634PG2WELUaucrU3OIuYt6LdDtPS5ay3J9aHuFcddaeZ6zuMnFO5Ds4UvBBeZzYwktGS60xDR+lQYlMwQEiKf9iMcXmobwfWuO94HbKFy83ge/qYNpMUviUd3WBD8DcsJOnyV94q95O7i1TVm4lTeqIuPyQZCQQdzY677YffjzrCzZzvbWynRYRhhBEd5y/DE0Bd02A/Ze7d2dWkSP2BI8SkQ//0KEWBNrE1aCUl2q20vtSYeDGZh/CE1XJOAcOVtVSgKAfhybsL+/79+pqrrU= 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)(366004)(346002)(136003)(39860400002)(376002)(396003)(451199021)(66476007)(66556008)(6486002)(110136005)(8676002)(478600001)(316002)(38100700002)(4326008)(41300700001)(8936002)(38350700002)(66946007)(186003)(83380400001)(6666004)(52116002)(26005)(6506007)(1076003)(6512007)(107886003)(5660300002)(86362001)(36756003)(2906002)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: efwBlQSlhJ5krHXPNJA0dSee+s5jKVofkqu5Wx6nv0VrXTNGkVfeftt7wjtm5le6K79sxL8wHbZ8f5L1SoldM0EeeA56uielyl8w2ziBnJfvyTOi4ow0mai60fUqzx24J3IujICcmylPdEJ1u7VOQuDzYtAL7LT67+GscnCPLEkum9TpriXHF4cM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yamiBGL3atMz6TZSWvwW2fNEpAZ+FNK6hjtj5BleFOymOCmsX4tM7YR+HceYaICdfCCI+10J8j4eK9KCj4+AVliKTbqydUWxhomzuezwmBz+SY3qAvM8sJrM42a/ArX7tiu5XeS89zYsfEM+yW53aS743yX+tZVmv4tJFE0qKzfmYOC4t4OzgfwA9EK7VopYICn5WqHoLUjjE71nbpJiNXwqF9MPDaknQBOnzYsXfER++FGAbOO88/kEcSJ/uX8PoXRlwNlkb1IObAhfVt0wAzyuGOimp9UG3EaOAos6hafarIn4gUdZsXQD9AtSzVsaNL0cduj0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b218ec6-9b19-40f0-f2fa-08db6cd2fba0 X-MS-Exchange-CrossTenant-AuthSource: SG2PR06MB3743.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2023 12:29:22.6278 (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: ZCXCQj1AvZ53KpAH3KsGugUt2fTI+tcfwT1N2I/ZlB1OIPSB/nlYDsGJ+XA2DPufAI1nBV+/6kjw5Bc7keFr6Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5849 Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org The return value of the ksmbd_vfs_getcasexattr() is long. However, the return value is being assigned to an unsignef long variable 'v_len',so making 'v_len' to long. silence the warning: ./fs/smb/server/vfs.c:433:6-11:WARNING: Unsigned expression compared with zero: v_len > 0 Signed-off-by: Wang Ming Acked-by: Namjae Jeon --- fs/smb/server/vfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index 23eb1da4b..77909b298 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -400,7 +400,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", @@ -417,7 +418,7 @@ 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; goto out;