lkml.org 
[lkml]   [1999]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [BUG] deadlock upon 'mv' on NFSROOT in 2.2.7


On Sun, 9 May 1999, Oren Laadan wrote:

> Hi,
>
> There appears to be a bug in 2.2.6 and 2.2.7 using NFSROOT - a deadlock
> when trying to rename a directory within the NFSROOT filesystem. For
> example:
> cd /lib
> mv modules modules-bug
> ...... [hang] ......
>
> I found out that: sys_rename() calls vfs_rename(), which tries to
> "down" a lock but fails, so it calls "__down_failed" which calls
> "__down". There it waits forever !!

Arrrrgh. Yup, with NFSROOT we create a root superblock not via
read_super(), so we have to initialize semaphore by hands.
The following should help:

--- fs/super.c Sun May 9 05:16:28 1999
+++ fs/super.c.new Sun May 9 13:39:08 1999
@@ -1131,6 +1131,7 @@
sb = get_empty_super(); /* "can't fail" */
sb->s_dev = get_unnamed_dev();
sb->s_flags = root_mountflags;
+ sema_init(&sb->s_vfs_rename_sem,1);
vfsmnt = add_vfsmnt(sb, "/dev/root", "/");
if (vfsmnt) {
if (nfs_root_mount(sb) >= 0) {
Linus, could you apply it?
TIA,
Al


-
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/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.035 / U:1.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site