[LU-16464] oxe_can_hold() causes unnecessary reallocations Created: 12/Jan/23  Updated: 27/Jan/23  Resolved: 27/Jan/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.15.2
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Nikitas Angelinas Assignee: Nikitas Angelinas
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

There are a couple off-by-one errors when calculating the required buffer size in oxe_can_hold(), which can cause the OSP xattr entry to be reallocated if it's not already present in the cache, e.g. in osp_xattr_get() it is first allocated in osp_oac_xattr_find_or_add()->osp_oac_xattr_alloc(), reallocated in osp_oac_xattr_assignment()->osp_oac_xattr_alloc() and the first entry is freed via osp_oac_xattr_assignment()->osp_oac_xattr_put().

00000004:00000001:0.0:1672773484.865928:0:70829:0:(osp_trans.c:495:osp_remote_sync()) Process leaving (rc=0 : 0 : 0)
00000004:00000010:0.0:1672773484.865929:0:70829:0:(osp_object.c:179:osp_oac_xattr_alloc()) kmalloced '(oxe)': 108 at 000000005f47abf6.
00000004:00000010:0.0:1672773484.865930:0:70829:0:(osp_object.c:179:osp_oac_xattr_alloc()) kmalloced '(oxe)': 108 at 00000000fd8ddabb.
00000004:00000010:0.0:1672773484.865930:0:70829:0:(osp_object.c:219:osp_oac_xattr_free()) kfreed 'oxe': 108 at 000000005f47abf6.
00000004:00000001:0.0:1672773484.865930:0:70829:0:(osp_object.c:1164:osp_xattr_get()) Process leaving via out (rc=56 : 56 : 0x38)



 Comments   
Comment by Gerrit Updater [ 12/Jan/23 ]

"Nikitas Angelinas <nikitas.angelinas@hpe.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49617
Subject: LU-16464 osp: fix off-by-one errors in oxe_can_hold()
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: ed21e9dfd8d17f4ede4f32a5a6c79d4890e3bfbd

Comment by Gerrit Updater [ 27/Jan/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49617/
Subject: LU-16464 osp: fix off-by-one errors in oxe_can_hold()
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: eac03ca97867240b3a1b3eced666a6a7aaddf60c

Comment by Peter Jones [ 27/Jan/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:27:15 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.