The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Semaphore block in fs/super.c mount_root
@ 2002-08-14 12:58 Agust Karlsson
  2002-08-14 13:32 ` David Woodhouse
  0 siblings, 1 reply; 3+ messages in thread
From: Agust Karlsson @ 2002-08-14 12:58 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

I have been trying to get a jffs2 file system to mount as root with kernel
2.4.18.
If I mount it as a "normal" mount point everything is OK, but if I use it as
a root device it blocks forever.
I have traced it down to the function mount_root in fs/super.c where I can
see that there is an up_read(&sb->s_umount) (line 1061) when we get the
super block directly just before the goto mount_it.
But where my jffs2 superblock gets read (line 1073) there is no such
up_read() and by tracing the calls from blkdev_put() (line 1077) I'll find
an down_read(&s->s_umount) in the function get_super() (line 518 same file).

By putting in an up_read(&sb->s_umount) just before blkdev_put() solves my
problem.
Do I need to increase the sb->s_active as well ???

Just wantet to point this out in case this is a bug.
BTW the down_write() just before the goto mount_it; has no effect as the
first statement after the label is up_write() on the same semapohre

Hereis a list of the relevant part of super.c with my alteration:
from line 1056:
	sb = get_super(ROOT_DEV);
	if (sb) {
		/* FIXME */
		p = (char *)sb->s_type->name;
		atomic_inc(&sb->s_active);
		up_read(&sb->s_umount);
		down_write(&sb->s_umount);
		goto mount_it;
	}
	for (p = fs_names; *p; p += strlen(p)+1) { 
		struct file_system_type * fs_type = get_fs_type(p);
		if (!fs_type)
  			continue;
		atomic_inc(&bdev->bd_count);
		retval = blkdev_get(bdev, mode, 0, BDEV_FS);
		if (retval)
			goto Eio;
  		sb = read_super(ROOT_DEV, bdev, fs_type,
				root_mountflags, root_mount_data);
		put_filesystem(fs_type);
		if (sb) {
                                    up_read(&sb->s_umount);  //This works
for jffs2
			blkdev_put(bdev, BDEV_FS);
			goto mount_it;
		}
	}

Best regards
Gusti
--
Agust Karlsson            mailto:gusti@pallas.dk
Pallas Informatik A/S     http://www.pallas.dk
Allerød Stationsvej 2D    Tel.: +45 48 10 24 10
DK-3450 Allerød           Fax.: +45 48 10 24 01



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Semaphore block in fs/super.c mount_root
  2002-08-14 12:58 Semaphore block in fs/super.c mount_root Agust Karlsson
@ 2002-08-14 13:32 ` David Woodhouse
  0 siblings, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2002-08-14 13:32 UTC (permalink / raw)
  To: Agust Karlsson; +Cc: 'linux-kernel@vger.kernel.org'


Gusti@pallas.dk said:
> I have been trying to get a jffs2 file system to mount as root with
> kernel 2.4.18.

http://lists.infradead.org/pipermail/linux-mtd/2002-March/004488.html
http://lists.infradead.org/pipermail/linux-mtd/2002-March/004489.html

--
dwmw2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Semaphore block in fs/super.c mount_root
@ 2002-08-14 13:40 Agust Karlsson
  0 siblings, 0 replies; 3+ messages in thread
From: Agust Karlsson @ 2002-08-14 13:40 UTC (permalink / raw)
  To: 'David Woodhouse', Agust Karlsson
  Cc: 'linux-kernel@vger.kernel.org'

Hi David.
Yes I saw that solution (after I had traced the semaphore :-) ), but as far
I can see the problem is the missing up_read() not the mtd driver.

Gusti

> -----Original Message-----
> From:	David Woodhouse [SMTP:dwmw2@infradead.org]
> Sent:	Wednesday, August 14, 2002 3:33 PM
> To:	Agust Karlsson
> Cc:	'linux-kernel@vger.kernel.org'
> Subject:	Re: Semaphore block in fs/super.c mount_root 
> 
> 
> Gusti@pallas.dk said:
> > I have been trying to get a jffs2 file system to mount as root with
> > kernel 2.4.18.
> 
> http://lists.infradead.org/pipermail/linux-mtd/2002-March/004488.html
> http://lists.infradead.org/pipermail/linux-mtd/2002-March/004489.html
> 
> --
> dwmw2
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-14 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-14 12:58 Semaphore block in fs/super.c mount_root Agust Karlsson
2002-08-14 13:32 ` David Woodhouse
  -- strict thread matches above, loose matches on Subject: below --
2002-08-14 13:40 Agust Karlsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox