[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] devtmpfs: Calling delete_path() only when necessary
2013/12/9 Greg Kroah-Hartman <>:
> On Wed, Dec 04, 2013 at 02:44:14PM +0800, Axel Lin wrote:
>> 2013/12/4 Rob Landley <>:
>> > On 11/16/2013 02:15:23 AM, Axel Lin wrote:
>> >>
>> >> The deleted variable is always 1 in current code.
>> >> Initialize deleted variable to be 0, so delete_path() will be called only
>> >> when
>> >> necessary.
>> >>
>> >> Signed-off-by: Axel Lin <>
>> >
>> >
>> > I'm not seeing this in linux-next, or a reply on the web archive. Assuming
>> > nobody's objected to this, you might want to forward it to
>> >
>> >
>> > That said, you could describe what it _does_ a little more?
>> I was expecting Greg to pick up this patch.
>> I thought the description is pretty clear.
>> What the patch does is changing the init value of deleted variable to 0.
>> The intention of this change is to avoid unnecessary delete_path() call.
> I agree the logic is a bit odd here, but are you seeing an "unnecessary"
> delete_path() call happening? The code has always been like this from
> what I can tell...

Honestly, I havn't see the "unnecessary" delete_path() call happening druing my
test. I look at the code when I was debugging a hangup issue.
(In the end, I think the issue is not related to the devtmpfs code.)
But I found the logic for the deleted variable looks odd.
There are below possible (unlikely) case:
When strchr(nodename, '/') != 0 and
1. If dentry->d_inode is NULL
2. vfs_getattr returns error
3. vfs_unlink returns error except -ENOENT.

In these cases, delete_path() will fail anyway.

Although this is a unlikely case, and I know the code is there since initial
commit. But I think it's still good to fix it.


 \ /
  Last update: 2013-12-09 10:21    [W:0.069 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site