All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
Cc: Tanya Brokhman <tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Huajun Li <huajun.li.lee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org,
	ablay-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	Jassi Brar
	<jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [RFC] usb: don't dput() in usbfs_rmdir()
Date: Mon, 30 May 2011 17:35:20 +0200	[thread overview]
Message-ID: <20110530153520.GA2386@linutronix.de> (raw)
In-Reply-To: <BANLkTimaMihxe75vTXDS1HivCbj8-v-pBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

rmmod of every hcd results currently in somethig like

|uhci_hcd 0000:00:01.2: USB bus 1 deregistered
|------------[ cut here ]------------
|kernel BUG at /home/bigeasy/git/linux/fs/dcache.c:419!
|invalid opcode: 0000 [#1]
|Modules linked in: uhci_hcd(-) ehci_hcd usbcore
|
|Pid: 1736, comm: rmmod Not tainted 3.0.0-rc1-00001-geb7d864-dirty #148 Bochs Bochs
|EIP: 0060:[<810c3f6b>] EFLAGS: 00010246 CPU: 0
|EIP is at dput+0x12b/0x130
|EAX: 00000000 EBX: af3ca9a0 ECX: af3cbd00 EDX: 00000202
|ESI: af3c6000 EDI: af3cbca8 EBP: aeae7ddc ESP: aeae7dd4
| DS: 007b ES: 007b FS: 0000 GS: 0033 SS: 0068
|Process rmmod (pid: 1736, ti=aeae6000 task=ae815c00 task.ti=aeae6000)
|Stack:
| af3ca9a0 af3c6000 aeae7dfc b0a489b6 af3cb9d8 af3cbcc0 af3caa10 aefb2230
| 00000000 00000000 aeae7e28 b0a48de5 afa37140 af402300 ade0a038 aeae7e40
| 810ae9f5 81177295 b0a4dce0 00000000 00000000 aeae7e44 81049395 aefb2230
|Call Trace:
| [<b0a489b6>] fs_remove_file+0x76/0x120 [usbcore]
| [<b0a48de5>] usbfs_notify+0x35/0x2d0 [usbcore]
| [<810ae9f5>] ? kfree+0x105/0x130
| [<81177295>] ? kobject_release+0x45/0x80
| [<81049395>] notifier_call_chain+0x45/0x60
| [<81049793>] __blocking_notifier_call_chain+0x43/0x70
| [<810497df>] blocking_notifier_call_chain+0x1f/0x30
| [<b0a46a39>] usb_notify_remove_bus+0x19/0x20 [usbcore]
| [<b0a3af0b>] usb_deregister_bus+0x5b/0x70 [usbcore]
| [<b0a3b011>] usb_remove_hcd+0xf1/0x100 [usbcore]

a bisect turned up:

|commit 64252c75a2196a0cf1e0d3777143ecfe0e3ae650
|Author: Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
|Date:   Tue May 24 13:06:05 2011 -0700
|
|    vfs: remove dget() from dentry_unhash()
|
|    This serves no useful purpose that I can discern.  All callers (rename,
|    rmdir) hold their own reference to the dentry.
|
|    A quick audit of all file systems showed no relevant checks on the value
|    of d_count in vfs_rmdir/vfs_rename_dir paths.
|
|    Signed-off-by: Sage Weil <sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org>
|    Signed-off-by: Al Viro <viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>

I removed the "inner" dput() which is called on emptry dir and sets error
to zero. This looks like the same change in 64252c7 for vfs_rmdir()
where dput() is removed from the path where we have dont_mount() and
S_DEAD.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
---
Could one of VFS ppl look at this an NACK/ACK it?

Jessi: I've seen your patch after I had mine done. If you send me a
sign-off-by for this, I will resend it with you as Author + SOB if you
like once the VFS are fine with this.

 drivers/usb/core/inode.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c
index 1b125c2..3ef9308 100644
--- a/drivers/usb/core/inode.c
+++ b/drivers/usb/core/inode.c
@@ -381,7 +381,6 @@ static int usbfs_rmdir(struct inode *dir, struct dentry *dentry)
 		dont_mount(dentry);
 		drop_nlink(dentry->d_inode);
 		drop_nlink(dentry->d_inode);
-		dput(dentry);
 		inode->i_flags |= S_DEAD;
 		drop_nlink(dir);
 		error = 0;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

       reply	other threads:[~2011-05-30 15:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c53791ee86b26aac740ff8db61454972.squirrel@www.codeaurora.org>
     [not found] ` <BANLkTinspCvVeP7k5faYio4YPRqGbnzzTg@mail.gmail.com>
     [not found]   ` <000001cc1eb1$6aa8e500$3ffaaf00$@org>
     [not found]     ` <BANLkTimaMihxe75vTXDS1HivCbj8-v-pBg@mail.gmail.com>
     [not found]       ` <BANLkTimaMihxe75vTXDS1HivCbj8-v-pBg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-30 15:35         ` Sebastian Andrzej Siewior [this message]
     [not found]           ` <20110530153520.GA2386-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-05-30 15:44             ` [RFC] usb: don't dput() in usbfs_rmdir() Jassi Brar
2011-05-30 20:27           ` Sage Weil
2011-05-31  9:53             ` Sebastian Andrzej Siewior
2011-05-31 16:11               ` Sage Weil
     [not found]                 ` <Pine.LNX.4.64.1105310909370.25709-vIokxiIdD2AQNTJnQDzGJqxOck334EZe@public.gmane.org>
2011-05-31 16:54                   ` Sergei Shtylyov

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=20110530153520.GA2386@linutronix.de \
    --to=bigeasy-hfztesqfncyowbw4kg4ksq@public.gmane.org \
    --cc=ablay-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org \
    --cc=huajun.li.lee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sage-BnTBU8nroG7k1uMJSBkQmQ@public.gmane.org \
    --cc=tlinder-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.