Skip to content

Commit 1cd6c96

Browse files
fs/ntfs3: Check 'folio' pointer for NULL
It can be NULL if bmap is called. Fixes: 82cae26 ("fs/ntfs3: Add initialization of super block") Signed-off-by: Konstantin Komarov <[email protected]>
1 parent b0a5dde commit 1cd6c96

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

fs/ntfs3/inode.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,18 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo,
571571
clear_buffer_uptodate(bh);
572572

573573
if (is_resident(ni)) {
574-
ni_lock(ni);
575-
err = attr_data_read_resident(ni, &folio->page);
576-
ni_unlock(ni);
577-
578-
if (!err)
579-
set_buffer_uptodate(bh);
574+
bh->b_blocknr = RESIDENT_LCN;
580575
bh->b_size = block_size;
576+
if (!folio) {
577+
err = 0;
578+
} else {
579+
ni_lock(ni);
580+
err = attr_data_read_resident(ni, &folio->page);
581+
ni_unlock(ni);
582+
583+
if (!err)
584+
set_buffer_uptodate(bh);
585+
}
581586
return err;
582587
}
583588

0 commit comments

Comments
 (0)