Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp602542lqb; Wed, 17 Apr 2024 06:08:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWzm0iE+d8/NVTni2KzY2NPLydCn6XaGfKk2P3sxAx8U7LvOR0BsDvpPCrxyYmGT52YhKKzXrx383WvAV+gVdP+rLELT62pDFsA1oWhkQ== X-Google-Smtp-Source: AGHT+IGgyYrS/ozp80LMhLBM+CC22KageLuRlDq8lC7GYaLbSHOb3TGdOt1AhugRDtvXxX6CDMl9 X-Received: by 2002:a19:ca57:0:b0:518:b36d:820e with SMTP id h23-20020a19ca57000000b00518b36d820emr7870767lfj.27.1713359291930; Wed, 17 Apr 2024 06:08:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713359291; cv=pass; d=google.com; s=arc-20160816; b=qgGwHkB3RoxwfqGsAQ65/3NZ/HZiLeqOtJtTUaGACDpMlS0Hb9qk1/BDefIu5lQ2hr GRZAM/2nUjtuhbRQLqAG/wk+2Of/41yNYCIBKWhJnymoG/iG2R/ESS+00GGTpZ/HOcdV D0sVoLBGZIFxRzunoxeZaqnOJCnPMVohjj2+pg03J6j9gulxtA9J0xfnMiIHfgX1ew6G 6r4S8DkIs1SHnhQQKznz4RfsLGVaE1h7NhcSGXy2yJ4etvi9jtAqM4AhMWO4Ta20tcz/ Uar1YxRpro7X5hn14QUmvsw/ncnK4hemQNV5iOsK3SDVqjGfFFlTdPV0SvJ5ies0qzc5 IbXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature; bh=IMyO98h2ap+R+a4RgdmKeCsdfzkIWjUB3lBQadUdqOQ=; fh=zpYi+jzbV23oc4qopJmiA3iay75E2bBh64Re5HvBJvQ=; b=JB+gzRLeVLSUdtKVI3AolDsyrJ2YdWSNHW9lwMNxpqlQLmYkiixCD6lGU+ZmsTndJq sIi6KEgyrCB5uy0zMazL5Xa0cDnxPWm2pZ1RhGFUM++Lv7gzvbn++uj93N5O1K6zePuX Zz24h98f6kMGRhuKC7LEaeSvXwvvYhZVVmcks9ETy11BWqSTb14XymkoRnDT1Bl5bzCA hyv2vp731jIWm/1B2fL0FYD64AynsBru8galcRGnWxZ3mg9p9fpSXgaf1CSN7fui2SnP m8zcXITIxKx9akOKOzFN9JWJh3U67F1NwLjiLC3JR3C5no491I+7PzAfp6KG/rQyHoXh NZxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=KH9DerAQ; dkim=pass header.i=@paragon-software.com header.s=mail header.b=dysMG+oi; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-148513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148513-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 am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y5-20020a50bb05000000b0056c38f7295fsi6608502ede.602.2024.04.17.06.08.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 06:08:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=KH9DerAQ; dkim=pass header.i=@paragon-software.com header.s=mail header.b=dysMG+oi; arc=pass (i=1 spf=pass spfdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dkim=pass dkdomain=paragon-software.com dmarc=pass fromdomain=paragon-software.com); spf=pass (google.com: domain of linux-kernel+bounces-148513-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148513-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C12CD1F21893 for ; Wed, 17 Apr 2024 13:08:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C7C5713DDDC; Wed, 17 Apr 2024 13:07:51 +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="KH9DerAQ"; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b="dysMG+oi" 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 BBC6F139F; Wed, 17 Apr 2024 13:07:48 +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=1713359271; cv=none; b=koYPONM9QLrSlnoWrWRet5ckquYlE6M2adXEAHQx5mskY8qOyIU5H66B2F57MRuGgQnuvKmabWa1dEvz3dkNST+3wZNah1oqpHFKjpFtR//Fcsr9KgSHA/puT5JkmGDZplzHmwzgTxPyEY1ck2jjjdQBG6z/LDmDZbQlddFYfhI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713359271; c=relaxed/simple; bh=lmasahfYKfVOBZlqGI9lYCBg9fkni9arTHpxK4mtGXw=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=tIBnZuhAASw4+uwKHYJVdrktd5Qibrg0k1bmZLG7p+1iSTnb2P6nszuHph1LYRL+GTHlnPKKCOpr2Ldh2T2Q3ULSPZLhrwuE1UIsmoGLpUtGf1HB/zXnvWzOYF3gEyuJFq1XRpXJOue1LqSsBPU/duxEs9kMz2ZbFw0Rzy+0MTM= 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=KH9DerAQ; dkim=pass (1024-bit key) header.d=paragon-software.com header.i=@paragon-software.com header.b=dysMG+oi; 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 relayfre-01.paragon-software.com (unknown [172.30.72.12]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 11E1D2126; Wed, 17 Apr 2024 13:00:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1713358818; bh=IMyO98h2ap+R+a4RgdmKeCsdfzkIWjUB3lBQadUdqOQ=; h=Date:Subject:From:To:References:In-Reply-To; b=KH9DerAQZXwiD/zM3X17AjS+GPdu7Y8kHwmMAh+GcEHp4ZY0SEEASN6tO7nzyq/Pm Euii0gQAmT5qhLo1c2Au0ZDHC9XeX2HRqcZZGdcunaaabLLX2VDJwnPnBPTn4+rgud gUA7cYpt3szPv5RM9aryTpBeIBUeRoZRMik1GXNE= 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 03BC935D; Wed, 17 Apr 2024 13:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1713359267; bh=IMyO98h2ap+R+a4RgdmKeCsdfzkIWjUB3lBQadUdqOQ=; h=Date:Subject:From:To:References:In-Reply-To; b=dysMG+oiiCetBRdhchoD5f2jOZhun7Gi7zy8ArGOJj2n+ANbkjGNM1RtT4qfqx2dE lw0XLZ2zALJKturXwTgTVunvLxkCSlItw4fktGKVC+Jji+E1LHBtJAZon5L+k7I0tl fyl736oKMIz7femYL5+WKArSkhvChHl3jxUuVuN4= Received: from [192.168.211.39] (192.168.211.39) 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; Wed, 17 Apr 2024 16:07:46 +0300 Message-ID: Date: Wed, 17 Apr 2024 16:07:46 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 07/11] fs/ntfs3: Check 'folio' pointer for NULL From: Konstantin Komarov To: , LKML , Linux-fsdevel References: <6c99c1bd-448d-4301-8404-50df34e8df8e@paragon-software.com> Content-Language: en-US In-Reply-To: <6c99c1bd-448d-4301-8404-50df34e8df8e@paragon-software.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) It can be NULL if bmap is called. Signed-off-by: Konstantin Komarov ---  fs/ntfs3/inode.c | 17 +++++++++++------  1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 85a10d4a74c4..94177c1dd818 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -570,13 +570,18 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,      clear_buffer_uptodate(bh);      if (is_resident(ni)) { -        ni_lock(ni); -        err = attr_data_read_resident(ni, &folio->page); -        ni_unlock(ni); - -        if (!err) -            set_buffer_uptodate(bh); +        bh->b_blocknr = RESIDENT_LCN;          bh->b_size = block_size; +        if (!folio) { +            err = 0; +        } else { +            ni_lock(ni); +            err = attr_data_read_resident(ni, &folio->page); +            ni_unlock(ni); + +            if (!err) +                set_buffer_uptodate(bh); +        }          return err;      } -- 2.34.1