From: OGAWA Hirofumi - uses just printk() instead of unneeded fat_fs_panic() - removes the debug printk - less verbose on error path - uses correct a error number on error path fs/fat/inode.c | 6 +++--- fs/msdos/namei.c | 16 ++++++---------- fs/vfat/namei.c | 37 +++++++++---------------------------- 3 files changed, 18 insertions(+), 41 deletions(-) diff -puN fs/fat/inode.c~fat-10-panic-removal fs/fat/inode.c --- 25/fs/fat/inode.c~fat-10-panic-removal 2003-12-21 22:19:13.000000000 -0800 +++ 25-akpm/fs/fat/inode.c 2003-12-21 22:19:13.000000000 -0800 @@ -1226,10 +1226,10 @@ retry: } lock_kernel(); if (!(bh = sb_bread(sb, i_pos >> MSDOS_SB(sb)->dir_per_block_bits))) { - fat_fs_panic(sb, "unable to read i-node block (i_pos %lld)", - i_pos); + printk(KERN_ERR "FAT: unable to read inode block " + "for updating (i_pos %lld)", i_pos); unlock_kernel(); - return; + return /* -EIO */; } spin_lock(&fat_inode_lock); if (i_pos != MSDOS_I(inode)->i_pos) { diff -puN fs/msdos/namei.c~fat-10-panic-removal fs/msdos/namei.c --- 25/fs/msdos/namei.c~fat-10-panic-removal 2003-12-21 22:19:13.000000000 -0800 +++ 25-akpm/fs/msdos/namei.c 2003-12-21 22:19:13.000000000 -0800 @@ -244,13 +244,14 @@ static int msdos_add_entry(struct inode */ dir->i_ctime = dir->i_mtime = CURRENT_TIME; mark_inode_dirty(dir); - memcpy((*de)->name,name,MSDOS_NAME); + + memcpy((*de)->name, name, MSDOS_NAME); (*de)->attr = is_dir ? ATTR_DIR : ATTR_ARCH; if (is_hid) (*de)->attr |= ATTR_HIDDEN; (*de)->start = 0; (*de)->starthi = 0; - fat_date_unix2dos(dir->i_mtime.tv_sec,&(*de)->time,&(*de)->date); + fat_date_unix2dos(dir->i_mtime.tv_sec, &(*de)->time, &(*de)->date); (*de)->size = 0; mark_buffer_dirty(*bh); return 0; @@ -393,7 +394,6 @@ out_unlock: return res; mkdir_error: - printk(KERN_WARNING "msdos_mkdir: error=%d, attempting cleanup\n", res); inode->i_nlink = 0; inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME; dir->i_nlink--; @@ -468,13 +468,9 @@ static int do_msdos_rename(struct inode if (error) goto out; } - error = fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh, - &dotdot_de, &dotdot_i_pos); - if (error < 0) { - printk(KERN_WARNING - "MSDOS: %s/%s, get dotdot failed, ret=%d\n", - old_dentry->d_parent->d_name.name, - old_dentry->d_name.name, error); + if (fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh, + &dotdot_de, &dotdot_i_pos) < 0) { + error = -EIO; goto out; } } diff -puN fs/vfat/namei.c~fat-10-panic-removal fs/vfat/namei.c --- 25/fs/vfat/namei.c~fat-10-panic-removal 2003-12-21 22:19:13.000000000 -0800 +++ 25-akpm/fs/vfat/namei.c 2003-12-21 22:19:13.000000000 -0800 @@ -25,23 +25,6 @@ #include #include -#define DEBUG_LEVEL 0 -#if (DEBUG_LEVEL >= 1) -# define PRINTK1(x) printk x -#else -# define PRINTK1(x) -#endif -#if (DEBUG_LEVEL >= 2) -# define PRINTK2(x) printk x -#else -# define PRINTK2(x) -#endif -#if (DEBUG_LEVEL >= 3) -# define PRINTK3(x) printk x -#else -# define PRINTK3(x) -#endif - static int vfat_hashi(struct dentry *parent, struct qstr *qstr); static int vfat_hash(struct dentry *parent, struct qstr *qstr); static int vfat_cmpi(struct dentry *dentry, struct qstr *a, struct qstr *b); @@ -699,7 +682,6 @@ static int vfat_build_slots(struct inode for (cksum = i = 0; i < 11; i++) { cksum = (((cksum&1)<<7)|((cksum&0xfe)>>1)) + msdos_name[i]; } - PRINTK3(("vfat_fill_slots 3: slots=%d\n",*slots)); for (ps = ds, slot = *slots; slot > 0; slot--, ps++) { ps->id = slot; @@ -716,7 +698,6 @@ static int vfat_build_slots(struct inode de = (struct msdos_dir_entry *) ps; shortname: - PRINTK3(("vfat_fill_slots 9\n")); /* build the entry of 8.3 alias name */ (*slots)++; memcpy(de->name, msdos_name, MSDOS_NAME); @@ -834,9 +815,6 @@ struct dentry *vfat_lookup(struct inode struct msdos_dir_entry *de; int table; - PRINTK2(("vfat_lookup: name=%s, len=%d\n", - dentry->d_name.name, dentry->d_name.len)); - lock_kernel(); table = (MSDOS_SB(dir->i_sb)->options.name_check == 's') ? 2 : 0; dentry->d_op = &vfat_dentry_ops[table]; @@ -969,7 +947,6 @@ int vfat_unlink(struct inode *dir, struc struct buffer_head *bh = NULL; struct msdos_dir_entry *de; - PRINTK1(("vfat_unlink: %s\n", dentry->d_name.name)); lock_kernel(); res = vfat_find(dir,&dentry->d_name,&sinfo,&bh,&de); if (res < 0) { @@ -1050,14 +1027,18 @@ int vfat_rename(struct inode *old_dir,st new_inode = new_dentry->d_inode; lock_kernel(); res = vfat_find(old_dir,&old_dentry->d_name,&old_sinfo,&old_bh,&old_de); - PRINTK3(("vfat_rename 2\n")); - if (res < 0) goto rename_done; + if (res < 0) + goto rename_done; is_dir = S_ISDIR(old_inode->i_mode); - if (is_dir && (res = fat_scan(old_inode,MSDOS_DOTDOT,&dotdot_bh, - &dotdot_de,&dotdot_i_pos)) < 0) - goto rename_done; + if (is_dir) { + if (fat_scan(old_inode, MSDOS_DOTDOT, &dotdot_bh, + &dotdot_de, &dotdot_i_pos) < 0) { + res = -EIO; + goto rename_done; + } + } if (new_dentry->d_inode) { res = vfat_find(new_dir,&new_dentry->d_name,&sinfo,&new_bh, _