Fix a missing error check for sync_buffer_dirty().

Signed-off-by: OGAWA Hirofumi <[EMAIL PROTECTED]>
---

 fs/fat/inode.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff -puN fs/fat/inode.c~sync08-fat_tweak6 fs/fat/inode.c
--- linux-2.6.11/fs/fat/inode.c~sync08-fat_tweak6       2005-03-06 
02:37:26.000000000 +0900
+++ linux-2.6.11-hirofumi/fs/fat/inode.c        2005-03-06 02:37:26.000000000 
+0900
@@ -463,18 +463,20 @@ static int fat_write_inode(struct inode 
        struct buffer_head *bh;
        struct msdos_dir_entry *raw_entry;
        loff_t i_pos;
+       int err = 0;
 
 retry:
        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;
-       }
+
        lock_kernel();
-       if (!(bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits))) {
+       bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits);
+       if (!bh) {
                printk(KERN_ERR "FAT: unable to read inode block "
                       "for updating (i_pos %lld)\n", i_pos);
-               unlock_kernel();
-               return -EIO;
+               err = -EIO;
+               goto out;
        }
        spin_lock(&sbi->inode_hash_lock);
        if (i_pos != MSDOS_I(inode)->i_pos) {
@@ -502,11 +504,11 @@ retry:
        spin_unlock(&sbi->inode_hash_lock);
        mark_buffer_dirty(bh);
        if (wait)
-               sync_dirty_buffer(bh);
+               err = sync_dirty_buffer(bh);
        brelse(bh);
+out:
        unlock_kernel();
-
-       return 0;
+       return err;
 }
 
 int fat_sync_inode(struct inode *inode)
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to