From patchwork Fri Oct 28 17:08:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 12497 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp945741wru; Fri, 28 Oct 2022 10:12:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4AHhCtfa8LIdk9sybVDNDxucB7g0SAjd+7zl3fg3QtwbiqRynjABIhEjTBkKssued/WNnG X-Received: by 2002:a17:902:dac4:b0:186:c372:732a with SMTP id q4-20020a170902dac400b00186c372732amr346356plx.174.1666977134046; Fri, 28 Oct 2022 10:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666977134; cv=none; d=google.com; s=arc-20160816; b=xN87vFG2JF1Xr/dV2/+oZudxxsVvW1NuQIe9DWDvbENghYFIx+LijsNPikxZZDSkwP 0jN2SLIxDtcxTxgOsrled4T6MaeH2GUoL3gHFvyYkeCBDSIcyajwBN4f+vghJNTja1Ia VLGc11G7Gsk4nVKfK/Trs32IVAdIf78m8o7OTUmSacYqO0zDupyVzcLQa5IzskHs9Ami LDz/l7iAJ0qaBihSCN/tsCpOXMWzJHty9qMmUPtTmm3Sec14c+7PBdrAsiuynKeTVqp2 DFjorCt2dkQKZlhLTf0s9xRSxCHwUJvCTXwctpFdoHUR0wuj1jEgaHvDp09jXagr43Gg GLRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=TVrq+vQGb+av6ii3jqQDdjetxf7DCNwUg01zC3qewKs=; b=P2D201BIkadqJEP/fvPWZQmj00FWmmw856b+yKW9WuhkvS3zsrR2dfYrcwQTedE7nA uVyXCWV325IrRf8hxsQHuR71ouagOCiJL9W6pdPgHQbqOVlfpcuF7nFDycGcsnCgWyHb lbDfmbh2T1nwXC0zQ7EDVnbiShAkwBR+aVMKHfmCXC+/Qgcy4tkpzbV7oLebDc8TBfVp 3JTMLjZFD+4MOEE2EEY0+OrFih3ZaPzcGoMnb2k2Un8FxwRnJi1DhA35VhAG03lDtlTn YJw2eIHeJH+hgMtYcYkSDTGlChH6UilvhzyYUmZfx08KiY03I9HCuyirB/w620vwN/xB LdsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=gAXYhGKx; dkim=pass header.i=@paragon-software.com header.s=mail header.b=SP66XS7J; 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=paragon-software.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g1-20020a636b01000000b0046f729604f6si2034852pgc.174.2022.10.28.10.11.59; Fri, 28 Oct 2022 10:12:14 -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=@paragon-software.com header.s=mail header.b=gAXYhGKx; dkim=pass header.i=@paragon-software.com header.s=mail header.b=SP66XS7J; 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=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbiJ1RLB (ORCPT + 99 others); Fri, 28 Oct 2022 13:11:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbiJ1RKV (ORCPT ); Fri, 28 Oct 2022 13:10:21 -0400 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C55BF77547; Fri, 28 Oct 2022 10:08:12 -0700 (PDT) Received: from relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id D9FE9218D; Fri, 28 Oct 2022 17:05:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1666976731; bh=TVrq+vQGb+av6ii3jqQDdjetxf7DCNwUg01zC3qewKs=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=gAXYhGKxNxS9jnSw23PcRE5QSOyUUHsJS9hpwu6oX845dwVSgtxDTaYmuMZIQo+V9 6GcmRS4YmY7zplFzNuA4W1Vv6sY0QpIHvQvJNpuO91Or4DaZUNcpoAkRiW6iGxiPDW 4YOLMtZiCt+7tdxeyPSwh0Zp4SDG3KDHz2FDJmic= Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id D903FDD; Fri, 28 Oct 2022 17:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1666976890; bh=TVrq+vQGb+av6ii3jqQDdjetxf7DCNwUg01zC3qewKs=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=SP66XS7JeULWj/kAbmS0oBErTfmLbpWHzNenHpvvq2OrXoCm3M8C9xMZEWMk6qhZc JBR1wBN9NqKS5jjlM0i0P5j/gKDLH4fqIkoa37jFcIioV6374q76PrLPFu3uV5N5ao XEkH+gxx84TbiHvTDubs+tUbLMtrwJ0Qes6WjEvo= Received: from [172.30.8.65] (172.30.8.65) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 28 Oct 2022 20:08:10 +0300 Message-ID: <2f497702-ace1-9b3e-65d1-a7dc57623372@paragon-software.com> Date: Fri, 28 Oct 2022 20:08:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: [PATCH 14/14] fs/ntfs3: Make if more readable Content-Language: en-US From: Konstantin Komarov To: CC: , References: In-Reply-To: X-Originating-IP: [172.30.8.65] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747952215026379509?= X-GMAIL-MSGID: =?utf-8?q?1747952215026379509?= This way it looks better. Signed-off-by: Konstantin Komarov --- fs/ntfs3/record.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/ntfs3/record.c b/fs/ntfs3/record.c index a952cd7aa7a4..defce6a5c8e1 100644 --- a/fs/ntfs3/record.c +++ b/fs/ntfs3/record.c @@ -265,10 +265,9 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr) if (t16 + t32 > asize) return NULL; - if (attr->name_len && - le16_to_cpu(attr->name_off) + sizeof(short) * attr->name_len > t16) { + t32 = sizeof(short) * attr->name_len; + if (t32 && le16_to_cpu(attr->name_off) + t32 > t16) return NULL; - } return attr; }