Re: [PATCH] shrink_dcache_parent() races against shrink_dcache_memory()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 23, Kirill Korotaev wrote:

> 
> 1. this patch doesn't fix the whole problem. iput() after sb free is 
> still possible. So busy inodes after umount too.
> 2. it has big problems with locking...
> 

Yes, you're right. I'll fix that and send an updated version.

> >+			goto repeat;
> <<<< I would prefer to have "goto repeat" as it was before...
> >+		/* out */
> >+	}

Fair.

> >+	if (atomic_add_unless(&dentry->d_count, -1, 1))
> >+		return;
> <<<< I would better introduce __dput_locked() w/o atomic_dec_and_test() 
> instead of using this atomic_add_unless()...
> <<<< For me it looks like an obfuscation of a code, which must be clean 
> and tidy.

Then it isn't dput_locked() anymore and you have to manually dereference
before you use __dput_locked(). Doesn't sound better. I'll give it a try ...

> >+
> >+	spin_lock(&dcache_lock);
> >+	dput_locked(dentry, &free_list);
> >+	spin_unlock(&dcache_lock);
> >+
> <<<< 1. locking here is totally broken... spin_unlock() in dentry_iput()

Yes, I totally missed the locking issue here. I'll rework that one.

> <<<< 2. it doesn't help the situation I wrote to you,
> <<<<    since iput() can be done on inode _after_ sb freeing...

Hmm, will think about that one again. shrink_dcache_parent() and
shrink_dcache_memory()/dput() are not racing against each other now since the
reference counting is done before giving up dcache_lock and the select_parent
could start.

Regards,
	Jan

-- 
Jan Blunck                                               [email protected]
SuSE LINUX AG - A Novell company
Maxfeldstr. 5                                          +49-911-74053-608
D-90409 Nürnberg                                      http://www.suse.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux