[LU-6536] lum->lmm_stripe_count used unswabbed in llapi_layout_get_by_fd() Created: 28/Apr/15  Updated: 01/Sep/15  Resolved: 07/Jul/15

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

Type: Bug Priority: Major
Reporter: Ned Bass Assignee: Emoly Liu
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-2973 lov_mds_md not swabbed in ll_getxattr Closed
Rank (Obsolete): 9223372036854775807

 Description   

llapi_layout_get_by_fd() contains this code which uses lmm_stripe_count without first checking if the lov_user_md needs to be byte-swapped. This causes a false error on PowerPC clients.

        if (!S_ISDIR(st.st_mode) && object_count != lum->lmm_stripe_count) {
                errno = EINTR;
                goto out;
        }


 Comments   
Comment by Gerrit Updater [ 28/Apr/15 ]

Ned Bass (bass6@llnl.gov) uploaded a new patch: http://review.whamcloud.com/14633
Subject: LU-6536 llapi: lmm_stripe_count used unswabbed
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 325652177c8a7365943b792dde77afdc7759c987

Comment by Oleg Drokin [ 29/Apr/15 ]

HM, it's eally strange we don't do all theswabbing in the kernel and need to ask userspace to do it too.

Is this all that wise? Should we onvert to all-in-kernel swabbing?

Comment by Ned Bass [ 29/Apr/15 ]

Hi Oleg. The kernel swabs the lustre_user_md through the ioctl() interface but not getxattr(). The llapi_layout library functions use getxattr() to accommodate function shipping platforms that don't grok the ioctls. I recall discussing this behavior at length with John Hammond and we settled on things as they stand today. I'll have to dig up that discussion. I forget which Jira issue or gerrit review it happened in.

Comment by Oleg Drokin [ 29/Apr/15 ]

Ah, for xattr interface I agree we have no business changing anything

Comment by Ned Bass [ 29/Apr/15 ]

Oleg, see the review comments here http://review.whamcloud.com/#/c/5737/. The caveat for byte swapping through getxattr() is that setxattr() would have to accept LUM data in either endianness to avoid breaking tar. We decided not to go that route.

Comment by Gerrit Updater [ 07/May/15 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14633/
Subject: LU-6536 llapi: lmm_stripe_count used unswabbed
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3742646beeb658f321745f5c275836879b9d077d

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