]> git.hungrycats.org Git - linux/commitdiff
Add some printk's to tell us why and/or where ReiserFS is killing us
authorZygo Blaxell <zblaxell@dos.hungrycats.org>
Thu, 20 Nov 2008 21:11:51 +0000 (16:11 -0500)
committerZygo Blaxell <zblaxell@waya.furryterror.org>
Fri, 21 Nov 2008 21:39:16 +0000 (16:39 -0500)
fs/reiserfs/dir.c
fs/reiserfs/file.c
fs/reiserfs/journal.c
fs/reiserfs/namei.c
fs/reiserfs/resize.c
fs/reiserfs/stree.c
fs/reiserfs/super.c
fs/reiserfs/tail_conversion.c
fs/reiserfs/xattr.c

index e6b03d2020c1c51aedbe6e443ccc7e236c50d242..f5884e20ab77c49d7c3596b5402374e154887332 100644 (file)
@@ -127,6 +127,7 @@ static int reiserfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
                                        /* There is corrupted data in entry,
                                         * We'd better stop here */
                                        pathrelse(&path_to_entry);
+                                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                                        ret = -EIO;
                                        goto out;
                                }
index a804903d31d1e336e73072a7e15453a3eac59ce1..ee74f1d8494c58b243d45745c45ed74913020a0d 100644 (file)
@@ -150,7 +150,12 @@ static int reiserfs_sync_file(struct file *p_s_filp,
                blkdev_issue_flush(p_s_inode->i_sb->s_bdev, NULL);
        if (barrier_done < 0)
                return barrier_done;
-       return (n_err < 0) ? -EIO : 0;
+       if (n_err < 0) {
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
+               return -EIO;
+       } else {
+               return 0;
+       }
 }
 
 /* taken fs/buffer.c:__block_commit_write */
index c21df71943a635c7eedabbf36e0ae3ac6107c770..62a3d98ec1038f3a9e6bcf7902b3e9855d87dbdd 100644 (file)
@@ -874,6 +874,7 @@ static int write_ordered_buffers(spinlock_t * lock,
                 */
                if (!buffer_uptodate(bh) && buffer_dirty(bh)) {
                        clear_buffer_dirty(bh);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        ret = -EIO;
                }
                if (buffer_dirty(bh)) {
@@ -904,6 +905,7 @@ static int write_ordered_buffers(spinlock_t * lock,
                        spin_lock(lock);
                }
                if (!buffer_uptodate(bh)) {
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        ret = -EIO;
                }
                /* ugly interaction with invalidatepage here.
@@ -1124,6 +1126,7 @@ static int flush_commit_list(struct super_block *s,
 #ifdef CONFIG_REISERFS_CHECK
                        reiserfs_warning(s, "journal-601, buffer write failed");
 #endif
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        retval = -EIO;
                }
                put_bh(tbh);    /* once for journal_find_get_block */
@@ -1156,6 +1159,7 @@ static int flush_commit_list(struct super_block *s,
 #ifdef CONFIG_REISERFS_CHECK
                reiserfs_warning(s, "journal-615: buffer write failed");
 #endif
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                retval = -EIO;
        }
        bforget(jl->j_commit_bh);
@@ -1280,8 +1284,10 @@ static int _update_journal_header_block(struct super_block *p_s_sb,
        struct reiserfs_journal_header *jh;
        struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb);
 
-       if (reiserfs_is_journal_aborted(journal))
+       if (reiserfs_is_journal_aborted(journal)) {
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
+       }
 
        if (trans_id >= journal->j_last_flush_trans_id) {
                if (buffer_locked((journal->j_header_bh))) {
@@ -3142,10 +3148,12 @@ int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *th)
 {
        struct super_block *s = th->t_super;
        int ret = 0;
-       if (th->t_trans_id)
+       if (th->t_trans_id) {
                ret = journal_end(th, th->t_super, th->t_blocks_allocated);
-       else
+       } else {
                ret = -EIO;
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
+       }
        if (th->t_refcount == 0) {
                SB_JOURNAL(s)->j_persistent_trans--;
                kfree(th);
@@ -3344,6 +3352,7 @@ int journal_end(struct reiserfs_transaction_handle *th,
 
        if (!th->t_trans_id) {
                WARN_ON(1);
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
index c1add28dd45ec144ec946b3ddba2c06a340af405..b15775d45df60f4d76842db0c362cb5dacd6e17e 100644 (file)
@@ -367,6 +367,7 @@ static struct dentry *reiserfs_lookup(struct inode *dir, struct dentry *dentry,
        }
        reiserfs_write_unlock(dir->i_sb);
        if (retval == IO_ERROR) {
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return ERR_PTR(-EIO);
        }
 
@@ -489,6 +490,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th,
                pathrelse(&path);
 
                if (retval == IO_ERROR) {
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
 
@@ -879,6 +881,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
                retval = -ENOENT;
                goto end_rmdir;
        } else if (retval == IO_ERROR) {
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                retval = -EIO;
                goto end_rmdir;
        }
@@ -891,6 +894,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
        if (de.de_objectid != inode->i_ino) {
                // FIXME: compare key of an object and a key found in the
                // entry
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                retval = -EIO;
                goto end_rmdir;
        }
@@ -968,6 +972,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
                retval = -ENOENT;
                goto end_unlink;
        } else if (retval == IO_ERROR) {
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                retval = -EIO;
                goto end_unlink;
        }
@@ -978,6 +983,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
        if (de.de_objectid != inode->i_ino) {
                // FIXME: compare key of an object and a key found in the
                // entry
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                retval = -EIO;
                goto end_unlink;
        }
@@ -1266,6 +1272,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
        pathrelse(&old_entry_path);
        if (retval == IO_ERROR) {
                reiserfs_write_unlock(old_dir->i_sb);
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
@@ -1297,12 +1304,14 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                pathrelse(&dot_dot_entry_path);
                if (retval != NAME_FOUND) {
                        reiserfs_write_unlock(old_dir->i_sb);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
 
                /* inode number of .. must equal old_dir->i_ino */
                if (dot_dot_de.de_objectid != old_dir->i_ino) {
                        reiserfs_write_unlock(old_dir->i_sb);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
        }
@@ -1348,6 +1357,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                        pathrelse(&old_entry_path);
                        journal_end(&th, old_dir->i_sb, jbegin_count);
                        reiserfs_write_unlock(old_dir->i_sb);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
 
@@ -1368,6 +1378,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                        pathrelse(&old_entry_path);
                        journal_end(&th, old_dir->i_sb, jbegin_count);
                        reiserfs_write_unlock(old_dir->i_sb);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
 
@@ -1386,6 +1397,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
                                pathrelse(&old_entry_path);
                                journal_end(&th, old_dir->i_sb, jbegin_count);
                                reiserfs_write_unlock(old_dir->i_sb);
+                               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                                return -EIO;
                        }
                        copy_item_head(&dot_dot_ih,
index f71c3948edef8324ac68a71042fbc35209cb5ea3..21d838d9cefd45747de0f1dff42763961df73975 100644 (file)
@@ -134,6 +134,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
                        bh = sb_bread(s, i * s->s_blocksize * 8);
                        if (!bh) {
                                vfree(bitmap);
+                               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                                return -EIO;
                        }
                        memset(bh->b_data, 0, sb_blocksize(sb));
@@ -166,6 +167,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
                int jerr = journal_end(&th, s, 10);
                if (jerr)
                        return jerr;
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
@@ -184,6 +186,7 @@ int reiserfs_resize(struct super_block *s, unsigned long block_count_new)
                int jerr = journal_end(&th, s, 10);
                if (jerr)
                        return jerr;
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
index abbc64dcc8d453cd8bd2281e382c85c37bd4fbf6..0af47671885ed4a5f4e4c5f9fcfb44e52908b3a7 100644 (file)
@@ -1656,6 +1656,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
                if (n_ret_value == NO_DISK_SPACE)
                        reiserfs_warning(p_s_sb, "NO_DISK_SPACE");
                unfix_nodes(&s_cut_balance);
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
@@ -1996,6 +1997,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree
                    search_for_position_by_key(th->t_super, p_s_key,
                                               p_s_search_path);
                if (retval == IO_ERROR) {
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        retval = -EIO;
                        goto error_out;
                }
@@ -2083,6 +2085,7 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, struct treepath
                PROC_INFO_INC(th->t_super, insert_item_restarted);
                retval = search_item(th->t_super, key, p_s_path);
                if (retval == IO_ERROR) {
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        retval = -EIO;
                        goto error_out;
                }
index d318c7e663faff15eb08ced95d11a123f6297866..27ef65a808dbeee4c61a8e4176573fde0b708d9b 100644 (file)
@@ -2153,8 +2153,10 @@ static ssize_t reiserfs_quota_read(struct super_block *sb, int type, char *data,
                        memset(data, 0, tocopy);
                else {
                        bh = sb_bread(sb, tmp_bh.b_blocknr);
-                       if (!bh)
+                       if (!bh) {
+                               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                                return -EIO;
+                       }
                        memcpy(data, bh->b_data + offset, tocopy);
                        brelse(bh);
                }
@@ -2197,6 +2199,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
                else
                        bh = sb_getblk(sb, tmp_bh.b_blocknr);
                if (!bh) {
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        err = -EIO;
                        goto out;
                }
index f8121a1147e863e80039ba676939b9c5abd7bd7f..181e438bd078675a99bd6d1814e55e8f56018c07 100644 (file)
@@ -52,6 +52,7 @@ int direct2indirect(struct reiserfs_transaction_handle *th, struct inode *inode,
                                 "pasted or inserted byte exists in the tree %K. "
                                 "Use fsck to repair.", &end_key);
                pathrelse(path);
+               printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                return -EIO;
        }
 
index bb3cb5b7cdb2479d1b68b9eb2fa2521e54810490..729b991694db9031d41d785692be19b45db813cb 100644 (file)
@@ -245,6 +245,7 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir)
                        // FIXME: we could just skip part of directory which could
                        // not be read
                        pathrelse(&path_to_entry);
+                       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
                        return -EIO;
                }
 
@@ -392,6 +393,7 @@ static struct page *reiserfs_get_page(struct inode *dir, unsigned long n)
 
       fail:
        reiserfs_put_page(page);
+       printk("reiserfs: returning EIO at %s:%d\n", __FILE__, __LINE__);
        return ERR_PTR(-EIO);
 }