If reading the NTFS BIOS parameter block fails for any reason,
we will not attempt to continue to work towards finding an
NTFS filesystem on the disk/partition.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
/* Initialize the filesystem metadata and return blk size in bits */
static int ntfs_fs_init(struct fs_info *fs)
{
+ int read_count;
struct ntfs_bpb ntfs;
struct ntfs_sb_info *sbi;
struct disk *disk = fs->fs_dev->disk;
uint8_t mft_record_shift;
- disk->rdwr_sectors(disk, &ntfs, 0, 1, 0);
+ read_count = disk->rdwr_sectors(disk, &ntfs, 0, 1, 0);
+ if (!read_count)
+ return -1;
/* sanity check */
if (!ntfs_check_sb_fields(&ntfs))