Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1073317iob; Wed, 18 May 2022 21:24:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoK6TXOuZe6/TVGmUMphATajweFQDzWGn0/Q53jbOJpaR7k1NA1mTCmXTg/loo8X7oG7Jh X-Received: by 2002:a17:906:4786:b0:6f9:635f:72a7 with SMTP id cw6-20020a170906478600b006f9635f72a7mr2528011ejc.326.1652934276014; Wed, 18 May 2022 21:24:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652934276; cv=none; d=google.com; s=arc-20160816; b=kiKRlS7ZwgBKHjMwYg7vIt+ShavkY2rjWi+2gLI4IxpU4KKqAewMbnHLpU62UCyRTx FQlyGqsQWTmdfXTnTXpd3wf/QnxnUzKvM7RbG3FTKBWCv22S/RvZuomsyH/Cdb53gdNg qCHZJklxNsp7Gabrj6Egs3KdlkbrrZSs9eHbSuV/eoC4o9ljK00MBsOuf5heoGk8uLOh T3jAxMozhPDQyja1Q5A457LSMI7moUmrRlp7fRORXZEzJ3H8EyKiUbnrc9TeC3Ja58fQ LqCParw8JERCVBcGKHbxtkCOBfys5zaIcDLnVpzwcGrMyhvERGCTluFRJRPBudDa7lBj HJCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=G5WQdw4c9CJ2o62g2YMlNdRKkH+rvK3DtQKx0bMZIT8=; b=gh1pf9wUBysp9N5i4E6nCADmrjKPiSa0XKWKvn8p3MrR+xDMsgBItq/4N7TZCc7YTT diCNbInDBIrCWoUsTpzGaFL36M4rTke//VOsXn/4RQP4O2UshofV2dZLwUZBkJXu5lbZ Fz49vQ+78Mf62pCb7yyjXZN4Z47W9KCnilCeSq7P+42SgOYSdBABZp5t/cH/AhGsWzWp e0DXzJDabeNZpU6ntANK7Z9JlforkPH1sM7KTRzdaQ/Dwh60cX9ZH6UyflXzdtNkmvOa 5gqylBCD/cGfomW4kMO7nSBRXwSn3DeEwPOEWYAovQ8zci2D6PbyeZejWbcW3jJWU9hI 20Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sj33+a6e; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc12-20020a056402204c00b0042aa68f763asi3841696edb.595.2022.05.18.21.23.46; Wed, 18 May 2022 21:24:36 -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=@kernel.org header.s=k20201202 header.b=sj33+a6e; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232329AbiESAz6 (ORCPT + 99 others); Wed, 18 May 2022 20:55:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232107AbiESAzy (ORCPT ); Wed, 18 May 2022 20:55:54 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D57A2C4F; Wed, 18 May 2022 17:55:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id A6843CE229B; Thu, 19 May 2022 00:55:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF0BAC385A5; Thu, 19 May 2022 00:55:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652921747; bh=+w7bxSwboW1VzAC18RChvyM/QQVFk/VXGDrhCmYTkKM=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=sj33+a6eM/yrurgd05V1SCh9AA7YADFweeVAmx8tNxRPqzYEtQwcpd08oK+zQiX9H cVvMKMf1JnETwr8FhftPgWe38RNC/q4Da18MJNZzOxbevDGjx45BuX1OQgWyeLPLOj s4qBg1QdmS0vHtXE8UlmTYzt/7pRYyX6ogsN+pvkJ2xeg6h9qQUifiaPm8P4+Soo8o bHaHZjtcz/600JCQFnMpmSCCRU9iM/ImuEjn6/+vd4WCN7EC6ZU2H5s76M8jAoilYd XbdwGhI0+HktrUnM+Gz/AJ6LOb/pRwemUVp50kWkeyL/bbQHr6laC0z8wT/musQMu9 y0UltHu10rmBA== Received: by mail-wr1-f45.google.com with SMTP id r23so4986919wrr.2; Wed, 18 May 2022 17:55:47 -0700 (PDT) X-Gm-Message-State: AOAM5329j3KPSYLvAptok23PhE5TCAPIUVnBimyRFXsRt3Ys6BpwC4eN FLzNM2BR7cNNZLqsvhSxIYXp9ivD8mhQH9RRNrs= X-Received: by 2002:a5d:584a:0:b0:20c:5bad:11c1 with SMTP id i10-20020a5d584a000000b0020c5bad11c1mr1831044wrf.62.1652921746214; Wed, 18 May 2022 17:55:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:f344:0:0:0:0:0 with HTTP; Wed, 18 May 2022 17:55:45 -0700 (PDT) In-Reply-To: References: From: Namjae Jeon Date: Thu, 19 May 2022 09:55:45 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] fs/ntfs3: Don't clear upper bits accidentally in log_replay() To: Dan Carpenter Cc: Konstantin Komarov , ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-janitors , Kari Argillander , Kari Argillander Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 2022-05-09 18:03 GMT+09:00, Dan Carpenter : > The "vcn" variable is a 64 bit. The "log->clst_per_page" variable is a > u32. This means that the mask accidentally clears out the high 32 bits > when it was only supposed to clear some low bits. Fix this by adding a > cast to u64. > > Fixes: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") > Signed-off-by: Dan Carpenter Reviewed-by: Namjae Jeon > --- > Why am I getting new Smatch warnings in old ntfs3 code? It is a mystery. > > fs/ntfs3/fslog.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c > index 915f42cf07bc..0da339fda2f4 100644 > --- a/fs/ntfs3/fslog.c > +++ b/fs/ntfs3/fslog.c > @@ -5057,7 +5057,7 @@ int log_replay(struct ntfs_inode *ni, bool > *initialized) > goto add_allocated_vcns; > > vcn = le64_to_cpu(lrh->target_vcn); > - vcn &= ~(log->clst_per_page - 1); > + vcn &= ~(u64)(log->clst_per_page - 1); > > add_allocated_vcns: > for (i = 0, vcn = le64_to_cpu(lrh->target_vcn), > -- > 2.35.1 > > >