Messages in this thread Patch in this message | | | Date | Thu, 1 Oct 1998 16:32:30 +0200 (CEST) | From | Andrea Arcangeli <> | Subject | [patch] Re: / busy and 2.1.122 |
| |
On Thu, 1 Oct 1998, Stephen C. Tweedie wrote:
>> Hopefully this is just simple problem, but I just did an upgrade from >> 2.1.115 to 2.1.122, and now when I reboot, / is busy and not unmouting >> cleanly. Could this be a problem with the kernel?
Again I' ve not seen the original email (I am used to read Stephen emails...).
This my patch can help you to track down what' s the problem in your distribution (I am using it from some time).
patch against 2.1.123.
PS. Bill developed a patch to help too but Bill approch is useless in real-world.
--- devel/kernel-tree/linux-2.1.123/fs/inode.c Tue Sep 29 01:02:19 1998 +++ linux/fs/inode.c Wed Sep 30 00:31:03 1998 @@ -762,10 +762,31 @@ max_inodes = max; } +#ifdef INODE_PARANOIA +static void print_busy_inode(struct inode *inode) +{ + char *pname = "", *fname = ""; + + if (!list_empty(&inode->i_dentry)) { + struct dentry * dentry; + dentry = list_entry(inode->i_dentry.next, + struct dentry, d_alias); + pname = (char *) dentry->d_parent->d_name.name; + fname = (char *) dentry->d_name.name; + } + printk("file %s/%s(%ld) busy, count %d, state %lx, nlink %d\n", + pname, fname, inode->i_ino, inode->i_count, inode->i_state, + inode->i_nlink); +} +#endif + /* This belongs in file_table.c, not here... */ int fs_may_remount_ro(struct super_block *sb) { struct file *file; +#ifdef INODE_PARANOIA + unsigned int retval = 1; +#endif /* Check that no files are currently opened for writing. */ for (file = inuse_filps; file; file = file->f_next) { @@ -778,13 +799,33 @@ /* File with pending delete? */ if (inode->i_nlink == 0) +#ifdef INODE_PARANOIA + { + print_busy_inode(inode); + retval = 0; + continue; + } +#else return 0; +#endif /* Writable file? */ if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE)) +#ifdef INODE_PARANOIA + { + print_busy_inode(inode); + retval = 0; + continue; + } +#else return 0; +#endif } +#ifdef INODE_PARANOIA + return retval; +#else return 1; /* Tis' cool bro. */ +#endif } void update_atime (struct inode *inode)
Andrea[s] Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |