Whamcloud - gitweb
LU-1013 obdclass: lu_object_find miss to unlink object from LRU
authorFan Yong <yong.fan@whamcloud.com>
Sat, 11 Feb 2012 01:26:29 +0000 (09:26 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 11 Feb 2012 19:15:58 +0000 (14:15 -0500)
commitb9ccecd1453c5c76fe135048c39f149c241650c6
tree5bfc094f58b912e865f3c69acebefb7e20174a48
parent182c2f8a6dd1a7d8493e5442656a5071333beb17
LU-1013 obdclass: lu_object_find miss to unlink object from LRU

There is race condition between lu_object_find and lu_object_put.
For the case of two threads trying to find some object with the
same FID concurrently, and the object is not allocated in memory
yet, if the first thread adds the object into LRU list before the
second thread re-searching object hash table for inserting the
new object created by itself, then the second thread will find
the object created by the first thread. Under such case, the
second thread should unlink the object from LRU.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: Iadec96c27d5285f8b859b0060a6f611e87585789
Reviewed-on: http://review.whamcloud.com/2134
Tested-by: Hudson
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdclass/lu_object.c