Whamcloud - gitweb
LU-9679 osc: fix to return right weight in osc_lock_weight() 35/37735/2
authorWang Shilong <wshilong@ddn.com>
Thu, 27 Feb 2020 01:36:05 +0000 (09:36 +0800)
committerOleg Drokin <green@whamcloud.com>
Thu, 5 Mar 2020 22:35:34 +0000 (22:35 +0000)
commit1676073d49b314ade314170ad9758cc878c14703
tree66cd5a73b4874f326a6947238925e0480eb9e6da
parent07b6193c84f3ccd21b2d3fdb7c7a9e6260c53ff4
LU-9679 osc: fix to return right weight in osc_lock_weight()

cl_io_init() might return a negative value, it could be indicated
lock should be not eliminated, osc_lock_weight() expect a positive
value, fix to return 1 in this case.

This is not a problem for now, as osc_io_init() only return 0,
To avoid any potential issues in the future, better fix it.

Test-Parameters: trivial
Change-Id: I657e5dcc4bb7691bf3b4ca06df7cb87945008a93
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/37735
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_lock.c