Re: [PATCH v4 1/1] dcache: Translating dentry into pathname without taking rename_lock

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

 



On 09/09/2013 02:36 PM, Al Viro wrote:
On Mon, Sep 09, 2013 at 07:21:11PM +0100, Al Viro wrote:
Actually, it's better for prepend_path() as well, because it's actually

	rcu_read_lock();
	seq = read_seqbegin(&rename_lock);
again:
	....
	if (error)
		goto done;
	....
	if (!seqretry_and_lock(&rename_lock, seq))
		goto again;	/* now as writer */
done:
	seqretry_done(&rename_lock, seq);
	rcu_read_unlock();

Posted variant will sometimes hit the following path:
	* seq_readlock()
	* start generating the output
	* hit an error
[another process has taken and released rename_lock for some reason]
	* hit read_seqretry_and_unlock(), which returns 1.
	* retry everything with seq_writelock(), despite the error.

It's not too horrible (we won't be looping indefinitely, ignoring error
all along), but it's certainly subtle enough...
FWIW, what I propose is this (just the d_path-related parts):



I am fine with your proposed change as long as it gets the job done. It doesn't really matter if you do it or I do it.

Thank for taking the effort to make it better for us all.

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux