Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6589

llapi_layout_pattern_set() rejects valid pattern values

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.8.0
    • None
    • 3
    • 9223372036854775807

    Description

      The input validation for this function appears to have a typo. Presumably "&&" was intended instead of "||":

      	if (pattern != LLAPI_LAYOUT_DEFAULT ||
      	    pattern != LLAPI_LAYOUT_RAID0) {
      		errno = EOPNOTSUPP;
      		return -1;
      	}
      

      Attachments

        Activity

          [LU-6589] llapi_layout_pattern_set() rejects valid pattern values
          pjones Peter Jones added a comment -

          Landed for 2.8

          pjones Peter Jones added a comment - Landed for 2.8

          Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14784/
          Subject: LU-6589 llapi: ..._layout_pattern_set() rejects valid patterns
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 1d700aaf9ff785e062d8e4c6a8920f37265dd969

          gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14784/ Subject: LU-6589 llapi: ..._layout_pattern_set() rejects valid patterns Project: fs/lustre-release Branch: master Current Patch Set: Commit: 1d700aaf9ff785e062d8e4c6a8920f37265dd969
          rread Robert Read added a comment -

          No worries - I had to stare at it for a few minutes to convince myself it actually was as broken as I thought it was.

          rread Robert Read added a comment - No worries - I had to stare at it for a few minutes to convince myself it actually was as broken as I thought it was.

          My bad, didn't read the code correctly...

          adilger Andreas Dilger added a comment - My bad, didn't read the code correctly...
          rread Robert Read added a comment -

          This also rejects LLAPI_LAYOUT_DEFAULT, too.

          I noticed this problem while writing unit tests for my own tool.

          rread Robert Read added a comment - This also rejects LLAPI_LAYOUT_DEFAULT, too. I noticed this problem while writing unit tests for my own tool.
          pjones Peter Jones added a comment -

          Yang Sheng

          Could you please take care of this patch?

          Thanks

          Peter

          pjones Peter Jones added a comment - Yang Sheng Could you please take care of this patch? Thanks Peter

          Ned Bass (bass6@llnl.gov) uploaded a new patch: http://review.whamcloud.com/14784
          Subject: LU-6589 llapi: ..._layout_pattern_set() rejects valid patterns
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 3ffaa9456818da1e29231a317247bc2faa64b31d

          gerrit Gerrit Updater added a comment - Ned Bass (bass6@llnl.gov) uploaded a new patch: http://review.whamcloud.com/14784 Subject: LU-6589 llapi: ..._layout_pattern_set() rejects valid patterns Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 3ffaa9456818da1e29231a317247bc2faa64b31d

          I think Robert is right--it will reject any value other than LLAPI_LAYOUT_DEFAULT. I'll whip up a patch.

          nedbass Ned Bass (Inactive) added a comment - I think Robert is right--it will reject any value other than LLAPI_LAYOUT_DEFAULT. I'll whip up a patch.

          It isn't clear that this is actually a bug? LLAPI_LAYOUT_DEFAULT means "use the default values", so I can't see it makes sense to specify "use the default" at the same time as specifying something that may not be the default? Also, since LLAPI_LAYOUT_DEFAULT is not a simple bitfield it will also conflict with RAID0?

          Ned, any comment on this API usage?

          Robert, were you doing something in particular that failed this check, or merely code review?

          adilger Andreas Dilger added a comment - It isn't clear that this is actually a bug? LLAPI_LAYOUT_DEFAULT means "use the default values", so I can't see it makes sense to specify "use the default" at the same time as specifying something that may not be the default? Also, since LLAPI_LAYOUT_DEFAULT is not a simple bitfield it will also conflict with RAID0? Ned, any comment on this API usage? Robert, were you doing something in particular that failed this check, or merely code review?

          People

            ys Yang Sheng
            rread Robert Read
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: