[LU-6299] OSP does not handle zero length xattr values well Created: 26/Feb/15 Updated: 01/Jul/16 Resolved: 28/May/15 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.7.0 |
| Fix Version/s: | Lustre 2.8.0 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | John Hammond | Assignee: | Di Wang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Severity: | 3 |
| Rank (Obsolete): | 17639 |
| Description |
|
The OSP/OUT code assumes that xattr values always have a non-zero length. For example, static int out_xattr_set(struct tgt_session_info *tsi) { ... buf = object_update_param_get(update, 1, &buf_len); if (buf == NULL || buf_len == 0) { CERROR("%s: empty buf for xattr set: rc = %d\n", tgt_name(tsi->tsi_tgt), -EPROTO); RETURN(err_serious(-EPROTO)); } ... Here is what happens on 2.6.94-18-g7c82a9c t:lustre-release# cd /mnt/lustre t:lustre# lfs mkdir -c4 d0 t:lustre# setfattr -n user.foo d0 Message from syslogd@t at Feb 26 10:53:15 ... kernel:[ 409.511761] LustreError: 4876:0:(osp_object.c:1132:__osp_xattr_set()) ASSERTION( buf->lb_len > 0 && buf->lb_buf != ((void *)0) ) failed: Message from syslogd@t at Feb 26 10:53:15 ... kernel:[ 409.515616] LustreError: 4876:0:(osp_object.c:1132:__osp_xattr_set()) LBUG |
| Comments |
| Comment by Andreas Dilger [ 26/Feb/15 ] |
|
It surprises me that we don't have a test for setting zero-length xattrs. Maybe we do for regular files and not directories? Please add one for this test. The sanity test_102h and test_102k seem like they are close, but don't start with a zero-length xattr, and don't run on a directory. Seems a test_102hb is needed for testing xattrs on directories. |
| Comment by Andreas Dilger [ 11/May/15 ] |
|
Di, any update on this one? |
| Comment by Di Wang [ 11/May/15 ] |
|
Ah, did not notice this one, will work on it today |
| Comment by Gerrit Updater [ 13/May/15 ] |
|
wangdi (di.wang@intel.com) uploaded a new patch: http://review.whamcloud.com/14787 |
| Comment by Gerrit Updater [ 28/May/15 ] |
|
Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14787/ |
| Comment by Peter Jones [ 28/May/15 ] |
|
Landed for 2.8 |