]> git.baikalelectronics.ru Git - kernel.git/commit
CacheFiles: Fix a race in cachefiles_delete_object() vs rename
authorDavid Howells <dhowells@redhat.com>
Fri, 19 Feb 2010 18:14:21 +0000 (18:14 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 20 Feb 2010 15:06:35 +0000 (10:06 -0500)
commit40a79de17813189b09e5b809128577223679d3cd
treea18890c2ace7ffde0682e29c58230ffc1fcdde15
parent5f0b735244861f62ac07cb4b2ab2241b5227d2c4
CacheFiles: Fix a race in cachefiles_delete_object() vs rename

cachefiles_delete_object() can race with rename.  It gets the parent directory
of the object it's asked to delete, then locks it - but rename may have changed
the object's parent between the get and the completion of the lock.

However, if such a circumstance is detected, we abandon our attempt to delete
the object - since it's no longer in the index key path, it won't be seen
again by lookups of that key.  The assumption is that cachefilesd may have
culled it by renaming it to the graveyard for later destruction.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cachefiles/namei.c