Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp993508lqt; Fri, 7 Jun 2024 05:16:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzMGcwAtQiayE+52IyCv9tyHm7f146SpyYQsambgOLyHeUPzBdEhRBcpWRyQ+HMzI1uYPhGnooS8N1OkFFilxOcw9sFzQy04izlJvIQQ== X-Google-Smtp-Source: AGHT+IH5ZB5KxpJfwyUhyUEHJzetUtTKNhW/InjflUnVRDPlgw9moUJDz163JBu6sWoFY8OnAFi4 X-Received: by 2002:a81:91d4:0:b0:61b:3346:83ce with SMTP id 00721157ae682-62cd55ca8d1mr22364037b3.15.1717762597959; Fri, 07 Jun 2024 05:16:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717762597; cv=pass; d=google.com; s=arc-20160816; b=Ci6hgH0BMy2yR88ChfvSjeEMGP4XgKqT45GzBnWGFIMT9StCr6Xw2w1E7g8FPwXyhz 6i6NVnhb4/5dQwS+xsBc4c6DKQUIBHnvj2OOjj75CMsJVN5lpkp/1Irf09aKXyH2Komr l2rXTR8d1yR7UF3zS7YlYdpR0/ju5Uf4SvUPNsHpDMVKZQUIQ9yOCM1qjf1UfZo49jya ihPriPwWrhtso/l9vfpVqOVLbbYSJLN2LW9OUsPcPNw8GMWQ/YQtAH35l3skC5Z88PqU FNo94b/ZNU1H3uc33rs68zU22ReHTRPMMFenvOdft4hhsQvxzKjmQKbVE6vpSjtuW5Wo KlLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aobg9M4myEoXktEVGRM+0xcAgpfxxQ9zjd9s/UmvLs8=; fh=xoZo938iZo6Zo9BQRi1y1Y/2pdszedQYQQiMhZQzvOk=; b=vWFzr+3Gv/qdalS27K5onYTkaFZDn+Vn9OafgSJge5tnseOEBSWB1OjluXCMnEH1ER Moi3cwlmyBQ2aTc5oN+K+CuhJ9t8SZfvKy5W61/QUbrRK348ZcMfmblXImF6N3CbXB/A sR78Iv+YS3Ly5Y5bbqnX6vwTKjA2pyUzQuYpXBPqjqlVT/em7r+3o1W4Qo5vE9wTrsB6 DMfaVKWgoA5y7fsDARwYMjdaGXnTSolQ1mzdaEn3yObYDE51regEpaQv0KrzYnRQXGoh 7zEkYGKtzla4k/zPPR55Z+1x4O99/OJ2wbZS6IEWn4sj4m+yShfonuY2CFiBRXVwLph6 7YoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=H+8aHVOb; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-205994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-44038b169cfsi39012231cf.387.2024.06.07.05.16.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 05:16:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=H+8aHVOb; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-205994-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205994-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id A0BA61C237B3 for ; Fri, 7 Jun 2024 12:16:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DC6A193093; Fri, 7 Jun 2024 12:16:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b="H+8aHVOb" Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E5EC15B0F8; Fri, 7 Jun 2024 12:16:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.157.23.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717762575; cv=none; b=NAGuiLOd+kmys8ue6NHWHxTH/KlmMpWmpqCZPz9o+26J1P8/ea9PqleVG+Is1Bl4dtecbMobUybaxaig/PfX2U4ha3eVwPCT6p6T2NhMa8A1JXrsP7Lebqz/uYaMcQE6xSOsgZsHWCNk4E4lFKLiU04WiHtracTsFpyQG9KThmY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717762575; c=relaxed/simple; bh=39brRrOkSyHjVx1NS6TpkELccKG+ycIqjB0w7/UFVLY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XSTl+H6s1aQXPuh1TQSyzKDh2Qskvtw/SKVPIU2QGPDfoDXoI+KZuehdmoYwb9km6UTKEQYt8rSSHFKU9ECbgX/rjVYoLpohlqbX2WJiVzwWFnXLylzFy7idMZ9h60wa2qjlGDY6tHncooANlvdknL1TzPZu5suICegfycxMlf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com; spf=pass smtp.mailfrom=paragon-software.com; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b=H+8aHVOb; arc=none smtp.client-ip=35.157.23.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=paragon-software.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=paragon-software.com Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 3E1C22113; Fri, 7 Jun 2024 12:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1717762097; bh=aobg9M4myEoXktEVGRM+0xcAgpfxxQ9zjd9s/UmvLs8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=H+8aHVObd4lXT/Ta5dL1HBTR62lfD7fXbTMCZarCqU3cCUc04ASL60LAzRYbFYbcv YjKLZtpVFiz20lHjcUHzo8J81EkJ3JABZ2cjbuo5FsABbC5/H08G0IlSV0h6y8GT5/ Io8IyTG7F3xx5C5uQmy5Ia8K4vzZZJn5znp7M3ds= Received: from ntfs3vm.paragon-software.com (192.168.211.95) 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, 7 Jun 2024 15:16:10 +0300 From: Konstantin Komarov To: CC: , , Konstantin Komarov Subject: [PATCH 06/18] fs/ntfs3: Fix getting file type Date: Fri, 7 Jun 2024 15:15:36 +0300 Message-ID: <20240607121548.18818-7-almaz.alexandrovich@paragon-software.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240607121548.18818-1-almaz.alexandrovich@paragon-software.com> References: <20240607121548.18818-1-almaz.alexandrovich@paragon-software.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) An additional condition causes the mft record to be read from disk and get the file type dt_type. Fixes: 22457c047ed97 ("fs/ntfs3: Modified fix directory element type detection") Signed-off-by: Konstantin Komarov --- fs/ntfs3/dir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/ntfs3/dir.c b/fs/ntfs3/dir.c index 1937e8e612f8..858efe255f6f 100644 --- a/fs/ntfs3/dir.c +++ b/fs/ntfs3/dir.c @@ -326,7 +326,8 @@ static inline int ntfs_filldir(struct ntfs_sb_info *sbi, struct ntfs_inode *ni, * It does additional locks/reads just to get the type of name. * Should we use additional mount option to enable branch below? */ - if ((fname->dup.fa & FILE_ATTRIBUTE_REPARSE_POINT) && + if (((fname->dup.fa & FILE_ATTRIBUTE_REPARSE_POINT) || + fname->dup.ea_size) && ino != ni->mi.rno) { struct inode *inode = ntfs_iget5(sbi->sb, &e->ref, NULL); if (!IS_ERR_OR_NULL(inode)) { -- 2.34.1