LU-744 llite: reimplement ll_get_fsname()

ll_get_fsname() used to allocate a piece of memory to store fsname,
this is not needed and error prone because it requires the caller
to free that piece of memory.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ibc077b46728a1358e51a345ec13c966fc947c428
Reviewed-on: http://review.whamcloud.com/3704
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-2163 lprocfs: fix jobstats initialization race

If two threads are racing to add the same jobid into the job stats
list in lprocfs_job_stats_log(), one thread will lose the race from
cfs_hash_findadd_unique() and enter the "if (job != job2)" case.  It
could fail LASSERT(!cfs_list_empty(&job->js_list)) depending whether
the other thread in "else" added "job2" to the list first or not.

Simply locking the check for cfs_list_empty(&job->js_list) is not
sufficient to fix the race.  There would need to be locking over the
whole cfs_hash_findadd_unique() and cfs_list_add() calls, but since
ojs_lock is global for the whole OST this may have performance costs.

Instead, just remove the LASSERT() entirely, since it provides no
value, and the "losing" thread can happily use the job_stat struct
immediately since it was fully initialized in job_alloc().

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iecb17e2dc80621fd388295998df5708bcaabcab0
Reviewed-on: http://review.whamcloud.com/4263
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1595 build: allow longer component in summary

Allow a longer "component:" field in the commit summary message, up to
11 characters, for osd-ldiskfs.  This exceeded the 9-character limit.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Id0ed056e9b9efef07b26efeb9e2f4f1e8d500c1e
Reviewed-on: http://review.whamcloud.com/4174
Tested-by: Hudson
Reviewed-by: Bruce Korb <bruce_korb@xyratex.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2093 lod: fall back to RR allocation when QoS fails

lod_alloc_qos() checks is there enough OSPs to satisfy the request
checking OSP state with dt_statfs(), then it tries to reserve
objects on some of them. during the reservation the state of OSP
can change (due to broken connection, for example), then QoS code
might found less ready OSPs than required. this is a valid situation
and LOD should fallback to RR allocation.

sanity/116a added to verify this: dt_statfs() are still reporting
OSPs are good, but no actual object can be created on OSP with
index 1.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Iae6916f998070960eb47c71f2bc1e48adb2ac080
Reviewed-on: http://review.whamcloud.com/4241
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Tested-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2123 tests: sanity 57 and 129 can't detect fstype

In sanity test 57a,57b and 129 the function facet_type_fstype
is used to determine the file system backend. This function
does not actually exist so this test never run for the
ldiskfs case. The fix is to use the proper function which
is facet_fstype.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ia9766a3a2200c6ce2d48ff0265eb73a4d71c06e7
Reviewed-on: http://review.whamcloud.com/4230
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
LU-1972 mdt: declare RPC handlers in a sane way

Declare the MDT RPC handlers in a way that they can be found when
searching for them, otherwise the code is completely opaque when
looking for the handler for an RPC (e.g. MDS_CLOSE or LDLM_ENQUEUE).

While it might make sense to have macros replace a lot of repetetive
code blocks, it doesn't make sense to chop up the RPC names so badly
that they can never be found through normal searching.  Rename the
RPC handler definition macros to have more meaningful names, and
remove unused macros and special cases where not strictly necessary.

Rename a few OBD_FAIL_LDLM_ error injection hooks instead of making
the macros more complex for a small number of use cases.  These names
are only used internally, even if the values are used in the tests.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I8d4dc0709faeae4458c3563864268a00f8500c1e
Reviewed-on: http://review.whamcloud.com/4260
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>