Whamcloud - gitweb
LU-7345 obdclass: annotate locks in __local_file_create 57/16957/4
authorOlaf Faaland <faaland1@llnl.gov>
Tue, 27 Oct 2015 00:51:46 +0000 (17:51 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Sun, 15 Nov 2015 15:39:27 +0000 (15:39 +0000)
commit953e9e5e75ca12a5ef72bfe844c1216341af12c9
tree5c80bf3fbb3a20a8879f81e1479b7c134ec719b7
parent70e90c3f42ff0f1f28b6045ce42f7e1736bd88a5
LU-7345 obdclass: annotate locks in __local_file_create

dt_write_lock() is called for both the child and the parent dt_objects
when a directory is created.  This triggers a false positive in
lockdep when running with CONFIG_LOCKDEP=y, as the structure
containing the lock and the name of the lock is the same, and so it
appears to be a recursive lock attempt based on lock class.

This gives the two locks different subclasses so lockdep can
differentiate between them.

Also, osd-zfs osd_object_{read,write}_lock() functions currently
ignore the subclass (role) provided by the caller, calling down_read()
instead of down_read_nested() for example.

Make osd_zfs use the _nested variants so the role takes effect.

Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Change-Id: Iab79feadfbd7d1a5a06749ecb9f6888b55a78d73
Reviewed-on: http://review.whamcloud.com/16957
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/local_storage.c
lustre/obdclass/local_storage.h
lustre/osd-zfs/osd_object.c