mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jorgen Cederlof <jorgen.cederlof@cendio.se>
To: Alexander Viro <viro@math.psu.edu>
Cc: torvalds@transmeta.com, alan@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Bug in do_mount()
Date: Sat, 24 Mar 2001 18:28:53 +0100	[thread overview]
Message-ID: <20010324182853.A4090@ondska> (raw)
In-Reply-To: <20010324145822.B1353@ondska> <Pine.GSO.4.21.0103240904140.11914-100000@weyl.math.psu.edu>
In-Reply-To: <Pine.GSO.4.21.0103240904140.11914-100000@weyl.math.psu.edu>; from viro@math.psu.edu on Sat, Mar 24, 2001 at 09:13:46AM -0500

> >       if (list_empty(&sb->s_mounts))
> >               kill_super(sb, 0);
> > +     else
> > +             put_filesystem(fstype);
> >       goto unlock_out;
 
> Reference acquired by get_fs_type() is
> released by put_filesystem() (near fs_out), _NOT_ by kill_super().

Yes.

> kill_super() releases the reference stored in ->s_type (created
> by get_sb_...()). If superblock stays alive you should not release it.

get_sb_...() will do get_filesystem() even if superblock stays alive.

We get the filesystem twice, in get_fs_type() and get_sb_...(), but if
we goto 'fail:' and don't call kill_super(), we put the filesystem
only once (near fs_out). 

> What bug are you trying to fix?

foofs is a FS_SINGLE filesystem: 
(but the !nd.dentry->d_inode case should be no different)

# grep foofs /proc/modules 
foofs                 6736   0 (unused)
# mount NONE /mnt -t foofs
# grep foofs /proc/modules 
foofs                 6736   1
# mount NONE /mnt -t foofs
mount: NONE already mounted or /mnt busy
mount: according to mtab, NONE is already mounted on /mnt
# grep foofs /proc/modules 
foofs                 6736   2
# mount NONE /mnt -t foofs
mount: NONE already mounted or /mnt busy
mount: according to mtab, NONE is already mounted on /mnt
# grep foofs /proc/modules 
foofs                 6736   3
# umount /mnt
# grep foofs /proc/modules 
foofs                 6736   2
# umount /mnt
umount: /mnt: not mounted
# grep foofs /proc/modules 
foofs                 6736   2
# rmmod foofs
foofs: Device or resource busy


  reply	other threads:[~2001-03-24 17:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-24 13:58 Jorgen Cederlof
2001-03-24 14:13 ` Alexander Viro
2001-03-24 17:28   ` Jorgen Cederlof [this message]
2001-03-24 17:43     ` Alexander Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010324182853.A4090@ondska \
    --to=jorgen.cederlof@cendio.se \
    --cc=alan@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=viro@math.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®