libceph: fix log output race condition in OSD client

OSD client logging has a problem in get_osd() and put_osd().
For one logging output refcount_read() is called twice. If recount
value changes between both calls logging output is not consistent.

This patch prints out only the resulting value.

[ idryomov: don't make the log messages more verbose ]

Signed-off-by: Simon Buttgereit <simon.buttgereit@tu-ilmenau.de>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by Simon Buttgereit and committed by Ilya Dryomov d6c2f41e 7d0a66e4

+2 -4
+2 -4
net/ceph/osd_client.c
··· 1280 1280 static struct ceph_osd *get_osd(struct ceph_osd *osd) 1281 1281 { 1282 1282 if (refcount_inc_not_zero(&osd->o_ref)) { 1283 - dout("get_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref)-1, 1284 - refcount_read(&osd->o_ref)); 1283 + dout("get_osd %p -> %d\n", osd, refcount_read(&osd->o_ref)); 1285 1284 return osd; 1286 1285 } else { 1287 1286 dout("get_osd %p FAIL\n", osd); ··· 1290 1291 1291 1292 static void put_osd(struct ceph_osd *osd) 1292 1293 { 1293 - dout("put_osd %p %d -> %d\n", osd, refcount_read(&osd->o_ref), 1294 - refcount_read(&osd->o_ref) - 1); 1294 + dout("put_osd %p -> %d\n", osd, refcount_read(&osd->o_ref) - 1); 1295 1295 if (refcount_dec_and_test(&osd->o_ref)) { 1296 1296 osd_cleanup(osd); 1297 1297 kfree(osd);