summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-04-16 08:54:34 +0200
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-04-23 08:34:23 +0200
commit1cd6c96219c429ebcfa8e79a865277376c563803 (patch)
treee5ab083ea1ed9646a2c4f3d2f0c9f7f62d934f5d /fs
parentfs/ntfs3: Missed le32_to_cpu conversion (diff)
downloadlinux-1cd6c96219c429ebcfa8e79a865277376c563803.tar.xz
linux-1cd6c96219c429ebcfa8e79a865277376c563803.zip
fs/ntfs3: Check 'folio' pointer for NULL
It can be NULL if bmap is called. Fixes: 82cae269cfa95 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/ntfs3/inode.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 05f169018c4e..502a527e51cd 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -571,13 +571,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;
}