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

OSP does not handle zero length xattr values well

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.8.0
    • Lustre 2.7.0
    • None
    • 3
    • 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
      

      Attachments

        Issue Links

          Activity

            [LU-6299] OSP does not handle zero length xattr values well
            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/14787/
            Subject: LU-6299 osp: zero-length EA xattr_set for striped_dir
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: 1cf0952fc28b061932cec40022486a7f78573414

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/14787/ Subject: LU-6299 osp: zero-length EA xattr_set for striped_dir Project: fs/lustre-release Branch: master Current Patch Set: Commit: 1cf0952fc28b061932cec40022486a7f78573414

            wangdi (di.wang@intel.com) uploaded a new patch: http://review.whamcloud.com/14787
            Subject: LU-6299 osp: zero-length EA xattr_set for striped_dir
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 411b1631c005fd7e80f98f56b932363b9c3e13e5

            gerrit Gerrit Updater added a comment - wangdi (di.wang@intel.com) uploaded a new patch: http://review.whamcloud.com/14787 Subject: LU-6299 osp: zero-length EA xattr_set for striped_dir Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 411b1631c005fd7e80f98f56b932363b9c3e13e5
            di.wang Di Wang added a comment -

            Ah, did not notice this one, will work on it today

            di.wang Di Wang added a comment - Ah, did not notice this one, will work on it today

            Di, any update on this one?

            adilger Andreas Dilger added a comment - Di, any update on this one?

            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.

            adilger Andreas Dilger added a comment - 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.

            People

              di.wang Di Wang
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: