Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbbL1Uag (ORCPT ); Mon, 28 Dec 2015 15:30:36 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:40339 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752437AbbL1Uad (ORCPT ); Mon, 28 Dec 2015 15:30:33 -0500 Date: Mon, 28 Dec 2015 20:30:31 +0000 From: Al Viro To: Rajat Jain Cc: "linux-kernel@vger.kernel.org" , linux-newbie@vger.kernel.org, Greg Kroah-Hartman Subject: Re: debugfs_remove_recursive() while a file is in use by userspace Message-ID: <20151228203031.GI20997@ZenIV.linux.org.uk> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1003 Lines: 28 On Mon, Dec 28, 2015 at 12:27:22PM -0800, Rajat Jain wrote: > Hi, > > I wanted to understand the behavior taken when a module calls > debugfs_remove_recursive() on a directory, while files under that > directory may still be in use by the userspace (for instance an > ongoing read / write operation). > > Does the function wait > > (1) until all the currently executing file operation methods > (read/write/map etc) have returned? No > OR > (2) until the user has given up all references (descriptors) to the > files under the directory (i.e. until release() method has been > called)? ... and no. Don't use debugfs for objects that might have a finite lifetime, or you'll get trouble. And don't use debugfs outside of well-isolated testing systems. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/