From: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
To: Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] CIFS: Fix kernel crash on simultaneous mount/umount calls
Date: Thu, 9 Jun 2011 08:40:43 -0400 [thread overview]
Message-ID: <20110609124043.GA9621@infradead.org> (raw)
In-Reply-To: <1307622570-7141-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> static void
> cifs_put_super(struct super_block *sb)
> {
> + struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
> + if (cifs_sb == NULL) {
> + cFYI(1, "Empty cifs superblock info passed to put_super");
> + return;
> + }
> +
> + bdi_destroy(&cifs_sb->bdi);
This means you have a problem with the lifetime rules in cifs_do_mount.
The VFS only calls ->put_super if sb->s_root is set. So the rules for
the mount handler are to only set s_root once the superblock is fully
set up.
Also you should never call cifs_umount from the error handling in
cifs_do_mount. Until s_root is set, please unwind manually, after
that leave it to ->put_super.
> +
> +static void
> +cifs_kill_super(struct super_block *sb)
> +{
This also seems quite broken. If you fix up the mount path like
I suggested it won't be nessecary.
> int rc = 0;
> struct cifs_sb_info *cifs_sb;
>
> cFYI(1, "In cifs_put_super");
> cifs_sb = CIFS_SB(sb);
> if (cifs_sb == NULL) {
And this check should also be removed.
next prev parent reply other threads:[~2011-06-09 12:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 12:29 [PATCH] CIFS: Fix kernel crash on simultaneous mount/umount calls Pavel Shilovsky
[not found] ` <1307622570-7141-1-git-send-email-piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-06-09 12:40 ` Christoph Hellwig [this message]
[not found] ` <20110609124043.GA9621-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2011-06-09 16:30 ` Pavel Shilovsky
[not found] ` <BANLkTikmfKtDxG_6qg+6JiCT2FzF1FFfQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-10 6:00 ` Pavel Shilovsky
2011-06-11 9:43 ` Christoph Hellwig
[not found] ` <20110611094314.GA6217-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2011-06-11 11:12 ` Al Viro
[not found] ` <20110611111253.GD11521-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-11 14:00 ` Pavel Shilovsky
[not found] ` <BANLkTim==J7=-bEz1pahhKuxFdMFe2BnWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-17 3:54 ` Al Viro
[not found] ` <20110617035421.GO11521-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-17 14:08 ` Al Viro
[not found] ` <20110617140833.GA9563-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-20 12:54 ` Pavel Shilovsky
[not found] ` <BANLkTi=mH-9F9N4Gz8JJqL==Hm5p8Y1_tQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-20 12:59 ` Jeff Layton
[not found] ` <20110620085943.6371af1b-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-06-20 16:13 ` Steve French
[not found] ` <BANLkTinfETnDdcBFkQNq8pLZPQOGsVRuGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-20 16:15 ` Al Viro
[not found] ` <20110620161516.GU11521-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-24 8:47 ` Pavel Shilovsky
[not found] ` <BANLkTi=nYfiy0qnHPXs2fckCPNJXwbpi7Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-24 10:48 ` Jeff Layton
[not found] ` <20110624064810.495dec99-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-06-24 22:54 ` [git pull] ->mount() regression fixes for cifs Al Viro
[not found] ` <20110624225414.GA11013-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-06-24 23:03 ` Steve French
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=20110609124043.GA9621@infradead.org \
--to=hch-wegcikhe2lqwvfeawa7xhq@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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