|
@@ -562,26 +562,23 @@ static int fat_write_inode(struct inode *inode, int wait)
|
|
|
struct buffer_head *bh;
|
|
struct buffer_head *bh;
|
|
|
struct msdos_dir_entry *raw_entry;
|
|
struct msdos_dir_entry *raw_entry;
|
|
|
loff_t i_pos;
|
|
loff_t i_pos;
|
|
|
- int err = 0;
|
|
|
|
|
|
|
+ int err;
|
|
|
|
|
|
|
|
retry:
|
|
retry:
|
|
|
i_pos = MSDOS_I(inode)->i_pos;
|
|
i_pos = MSDOS_I(inode)->i_pos;
|
|
|
if (inode->i_ino == MSDOS_ROOT_INO || !i_pos)
|
|
if (inode->i_ino == MSDOS_ROOT_INO || !i_pos)
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
|
|
- lock_super(sb);
|
|
|
|
|
bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits);
|
|
bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits);
|
|
|
if (!bh) {
|
|
if (!bh) {
|
|
|
printk(KERN_ERR "FAT: unable to read inode block "
|
|
printk(KERN_ERR "FAT: unable to read inode block "
|
|
|
"for updating (i_pos %lld)\n", i_pos);
|
|
"for updating (i_pos %lld)\n", i_pos);
|
|
|
- err = -EIO;
|
|
|
|
|
- goto out;
|
|
|
|
|
|
|
+ return -EIO;
|
|
|
}
|
|
}
|
|
|
spin_lock(&sbi->inode_hash_lock);
|
|
spin_lock(&sbi->inode_hash_lock);
|
|
|
if (i_pos != MSDOS_I(inode)->i_pos) {
|
|
if (i_pos != MSDOS_I(inode)->i_pos) {
|
|
|
spin_unlock(&sbi->inode_hash_lock);
|
|
spin_unlock(&sbi->inode_hash_lock);
|
|
|
brelse(bh);
|
|
brelse(bh);
|
|
|
- unlock_super(sb);
|
|
|
|
|
goto retry;
|
|
goto retry;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -607,11 +604,10 @@ static int fat_write_inode(struct inode *inode, int wait)
|
|
|
}
|
|
}
|
|
|
spin_unlock(&sbi->inode_hash_lock);
|
|
spin_unlock(&sbi->inode_hash_lock);
|
|
|
mark_buffer_dirty(bh);
|
|
mark_buffer_dirty(bh);
|
|
|
|
|
+ err = 0;
|
|
|
if (wait)
|
|
if (wait)
|
|
|
err = sync_dirty_buffer(bh);
|
|
err = sync_dirty_buffer(bh);
|
|
|
brelse(bh);
|
|
brelse(bh);
|
|
|
-out:
|
|
|
|
|
- unlock_super(sb);
|
|
|
|
|
return err;
|
|
return err;
|
|
|
}
|
|
}
|
|
|
|
|
|