FID on OST (LU-1185)

[LU-2681] need to handle lsr_flags having other flags set Created: 25/Jan/13  Updated: 11/Apr/13  Resolved: 11/Apr/13

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

Type: Technical task Priority: Blocker
Reporter: Andreas Dilger Assignee: Di Wang
Resolution: Fixed Votes: 0
Labels: MB

Rank (Obsolete): 6268

 Description   

The "lsr_flags" field is currently treated as if it only held LU_SEQ_RANGE_MDT or LU_SEQ_RANGE_OST values. These cannot purely be treated as flags, since LU_SEQ_RANGE_MDT = 0 for compatibility reasons.

If the lsr_flags field ever gets other flags in the future, then checks using "==" instead of "&" will fail, for example:

lustre/osd-zfs/osd_oi.c:266

       if (range->lsr_flags == LU_SEQ_RANGE_OST)

A similar "==" check is made in fld_server_lookup().

Probably an LU_SEQ_RANGE_TYPE = 1 mask should be created, and then helper function can be created to check the type:

unsigned fld_range_type(struct lu_seq_range *range)
{
         return range->lsr_flags & LU_SEQ_RANGE_TYPE;
}

and it can be used like:

        if (fld_range_type(range) == LU_SEQ_RANGE_OST)
or
        if (fld_range_type(range) == LU_SEQ_RANGE_MDT)
or
        if (fld_range_type(erange) == fld_range_type(range))


 Comments   
Comment by Di Wang [ 05/Mar/13 ]

http://review.whamcloud.com/5589

Comment by Andreas Dilger [ 08/Apr/13 ]

Di, to confirm, is the change for LU_SEQ_RANGE_ALL (or LU_SEQ_RANGE_ANY) part of the wire protocol, or is this only for local FLD queries?

Comment by Di Wang [ 08/Apr/13 ]

This is part of wire protocol, client seq check will also need pack this RANGE_ALL(RANGE_ANY)flags.

Comment by Andreas Dilger [ 10/Apr/13 ]

New version of patch is at http://review.whamcloud.com/5999, 5589 is abandoned.

Comment by Peter Jones [ 11/Apr/13 ]

Landed for 2.4

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