From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergei Shtylyov Subject: Re: [RFC] usb: don't dput() in usbfs_rmdir() Date: Tue, 31 May 2011 20:54:29 +0400 Message-ID: <4DE51D45.8070909@ru.mvista.com> References: <000001cc1eb1$6aa8e500$3ffaaf00$@org> <20110530153520.GA2386@linutronix.de> <4DE4BA96.1090905@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Al Viro , Sebastian Andrzej Siewior , Tanya Brokhman , Huajun Li , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, greg-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org, ablay-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, Jassi Brar , linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sage Weil Return-path: In-Reply-To: Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-fsdevel.vger.kernel.org Hello. Sage Weil wrote: >>>> Could one of VFS ppl look at this an NACK/ACK it? >>> I think it's the other dput that you want to remove. 64252c75 is a >>> misleading because the first hunk has to remove dput() from every exit path >>> for the function. dentry_unhash is unconditionally doing dget, though. I >>> think we want >>> diff --git a/drivers/usb/core/inode.c b/drivers/usb/core/inode.c >>> index 1b125c2..2278dad 100644 >>> --- a/drivers/usb/core/inode.c >>> +++ b/drivers/usb/core/inode.c >>> @@ -389,7 +389,6 @@ static int usbfs_rmdir(struct inode *dir, struct dentry >>> *dentry) >>> mutex_unlock(&inode->i_mutex); >>> if (!error) >>> d_delete(dentry); >>> - dput(dentry); >>> return error; >>> } >> Yep, this is the correct one. I added a file and removed it after the hcd >> was gone and it only survived your way :) >> Are you going to post a complete patch or do you want me to do it? > Patch is below. Thanks for testing! > sage > From 2dbf6d8f7426980d4c0d8798222b2ce9eed76651 Mon Sep 17 00:00:00 2001 > From: Sage Weil > Date: Tue, 31 May 2011 09:09:16 -0700 > Subject: [PATCH] usb: remove bad dput after dentry_unhash > Commit 64252c75a removed the useless dget from dentry_unhash but didn't Please also specify that commit's summary in parens -- for the human readers. Commit ID is only immediately usable to gitweb. > fix up this caller in the usb code. There used to be exactly one dput per > dentry_unhash call; now there are none. > Tested-by: Sebastian Andrzej Siewior > Signed-off-by: Sage Weil WBR, Sergei -- 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