Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2733951rwi; Fri, 28 Oct 2022 10:31:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QiJe0jQCB5Zm3rOKPsiFWtieYNmuecIitGiUj4rXtCtZZD5g7cYOQS0zYwKaGdVra2+ov X-Received: by 2002:a05:6402:254f:b0:45d:3044:d679 with SMTP id l15-20020a056402254f00b0045d3044d679mr508940edb.137.1666978284204; Fri, 28 Oct 2022 10:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666978284; cv=none; d=google.com; s=arc-20160816; b=dSkj7uI8HM2C1lMuVVB5DxiQFqSATZlmo3XsEGNIMiGmta7Ee48DT/3cEJzwNoYd+v bg7wbdq49pqsHS/MU5GWHQ0hzgMEq0UNY9j2WwniB2ow5fcsM9aDCZn9NLkqgOdZRRDA oq7lOsF2r9qhiqY6UVJkTeZZt82VfOIeR1Ausa4CBbLqzzKeieyPo9+GAfwQofMguipm JdqQxbbl3fH1Te1L0Xmvr4A/gpiA0Oj83z7SxHI2hly/TO/5T431yl7jZ9m71z5cHv/m NpfLm/JU3CJCUW8KJjbSCQrLort5UgdPg8PJhmKFXdP2bHyBVphJFXyvjOAvgK9gMHW2 zGaw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fk25-20020a056402399900b00461c252c3f8si4331544edb.382.2022.10.28.10.30.57; Fri, 28 Oct 2022 10:31:24 -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: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit 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 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; } -- 2.37.0