Details

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

    Description

      Passing of valid pointers to PTR_ERR is unlikely to lead to desired effects, so we really need to do something about it.

      one example:

              wobdo = object_update_param_get(update, 0, &size);
              if (IS_ERR(wobdo) || size != sizeof(*wobdo)) {
                      CERROR("%s: obdo is NULL, invalid RPC: rc = %ld\n",
                             tgt_name(tsi->tsi_tgt), PTR_ERR(wobdo));
                      RETURN(PTR_ERR(wobdo));
              }
      

      List of triggers:

      lustre/target/out_handler.c:120 out_create() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:122 out_create() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:134 out_create() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:136 out_create() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:173 out_attr_set() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:175 out_attr_set() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:390 out_xattr_set() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:392 out_xattr_set() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:487 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:489 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:503 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:505 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:590 out_write() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:592 out_write() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:599 out_write() warn: passing a valid pointer to 'PTR_ERR'
      lustre/target/out_handler.c:601 out_write() warn: passing a valid pointer to 'PTR_ERR'
      

      Attachments

        Issue Links

          Activity

            [LU-11029] passing a valid pointer to PTR_ERR
            pjones Peter Jones added a comment -

            Merged for 2.17

            pjones Peter Jones added a comment - Merged for 2.17
            gerrit Gerrit Updater added a comment -

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58888/
            Subject: LU-11029 target: centralize size checking
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: beeb5c2dc834f0e097df57883a4467097e0a7875

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/58888/ Subject: LU-11029 target: centralize size checking Project: fs/lustre-release Branch: master Current Patch Set: Commit: beeb5c2dc834f0e097df57883a4467097e0a7875

            What tool did you use to find these?

            simmonsja James A Simmons added a comment - What tool did you use to find these?

            Please do not close tickets before the patch has landed. Otherwise, there is nothing tracking that this issue has not actually been fixed.

            adilger Andreas Dilger added a comment - Please do not close tickets before the patch has landed. Otherwise, there is nothing tracking that this issue has not actually been fixed.

            "Chakshu Kansal <ckansal@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58888
            Subject: LU-11029 target: Fix NULL check before PTR_ERR usage on wobdo
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: e11f60612baf914a1df0447eb53a1f2811b11b20

            gerrit Gerrit Updater added a comment - "Chakshu Kansal <ckansal@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/58888 Subject: LU-11029 target: Fix NULL check before PTR_ERR usage on wobdo Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: e11f60612baf914a1df0447eb53a1f2811b11b20
            cfaber Colin Faber added a comment -

            Hi ckansal can you please take a look? Thank you!

            cfaber Colin Faber added a comment - Hi ckansal can you please take a look? Thank you!

            People

              ckansal Chakshu Kansal
              green Oleg Drokin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: