if (!create)
return 0;
if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) {
- BUG();
+ fat_fs_panic(sb, "corrupted file size (i_pos %lld, %lld)",
+ MSDOS_I(inode)->i_pos, MSDOS_I(inode)->mmu_private);
return -EIO;
}
if (!((unsigned long)iblock & (MSDOS_SB(sb)->sec_per_clus - 1))) {
const unsigned int cluster_size = sbi->cluster_size;
int nr_clusters;
- /* Why no return value? Surely the disk could fail... */
- if (IS_RDONLY (inode))
- return /* -EPERM */;
- if (IS_IMMUTABLE(inode))
- return /* -EPERM */;
-
/*
* This protects against truncating a file bigger than it was then
* trying to write into the hole.