hfsplus: ensure bio requests are not smaller than the hardware sectors
[linux-2.6.git] / fs / hfsplus / super.c
index 84f56e1..c106ca2 100644 (file)
@@ -203,17 +203,17 @@ int hfsplus_sync_fs(struct super_block *sb, int wait)
                write_backup = 1;
        }
 
-       error2 = hfsplus_submit_bio(sb->s_bdev,
+       error2 = hfsplus_submit_bio(sb,
                                   sbi->part_start + HFSPLUS_VOLHEAD_SECTOR,
-                                  sbi->s_vhdr, WRITE_SYNC);
+                                  sbi->s_vhdr_buf, NULL, WRITE_SYNC);
        if (!error)
                error = error2;
        if (!write_backup)
                goto out;
 
-       error2 = hfsplus_submit_bio(sb->s_bdev,
+       error2 = hfsplus_submit_bio(sb,
                                  sbi->part_start + sbi->sect_count - 2,
-                                 sbi->s_backup_vhdr, WRITE_SYNC);
+                                 sbi->s_backup_vhdr_buf, NULL, WRITE_SYNC);
        if (!error)
                error2 = error;
 out:
@@ -257,8 +257,8 @@ static void hfsplus_put_super(struct super_block *sb)
        hfs_btree_close(sbi->ext_tree);
        iput(sbi->alloc_file);
        iput(sbi->hidden_dir);
-       kfree(sbi->s_vhdr);
-       kfree(sbi->s_backup_vhdr);
+       kfree(sbi->s_vhdr_buf);
+       kfree(sbi->s_backup_vhdr_buf);
        unload_nls(sbi->nls);
        kfree(sb->s_fs_info);
        sb->s_fs_info = NULL;