vserver 1.9.3
[linux-2.6.git] / fs / fat / file.c
index 00cb5d7..3b48219 100644 (file)
@@ -47,7 +47,8 @@ int fat_get_block(struct inode *inode, sector_t iblock,
        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))) {
@@ -89,12 +90,6 @@ void fat_truncate(struct inode *inode)
        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.