Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-1249

with fuse-dfs, chown which only has owner (or only group) argument fails with Input/output error.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.20.1, 0.20.2
    • Fix Version/s: 2.0.2-alpha
    • Component/s: fuse-dfs
    • Labels:
    • Environment:

      x86 linux (ubuntu 10.04)

    • Hadoop Flags:
      Reviewed

      Description

      with fuse-dfs, chown which only has owner (or only group) argument fails with Input/output error.
      ----------
      /mnt/hdfs/tmp# chown root file1
      chown: changing ownership of `file1': Input/output error
      /mnt/hdfs/tmp# chown root:root file1
      /mnt/hdfs/tmp# chown :root file1
      chown: changing group of `file1': Input/output error
      ----------
      I think it should be treated as unchanged for missing part(owner or group) instead of returning an error.

      I took fuse_dfs log and it is saying
      ----------
      unique: 25, opcode: SETATTR (4), nodeid: 14, insize: 128
      chown /tmp/file1 0 4294967295
      could not lookup group -1
      unique: 25, error: -5 (Input/output error), outsize: 16
      unique: 26, opcode: SETATTR (4), nodeid: 14, insize: 128
      chown /tmp/file1 0 0
      getattr /tmp/file1
      unique: 26, success, outsize: 120
      unique: 27, opcode: SETATTR (4), nodeid: 14, insize: 128
      chown /tmp/file1 4294967295 0
      could not lookup userid -1
      unique: 27, error: -5 (Input/output error), outsize: 16
      ----------

      therefore this should happen because dfs_chown() in src/contrib/fuse-dfs/src/fuse_impls_chown.c has following
      ----------
      ...
      user = getUsername(uid);
      if (NULL == user)

      { syslog(LOG_ERR,"Could not lookup the user id string %d\n",(int)uid); fprintf(stderr, "could not lookup userid %d\n", (int)uid); ret = -EIO; }

      if (0 == ret) {
      group = getGroup(gid);
      if (group == NULL)

      { syslog(LOG_ERR,"Could not lookup the group id string %d\n",(int)gid); fprintf(stderr, "could not lookup group %d\n", (int)gid); ret = -EIO; }


      }
      ...
      ----------

      but actually, hdfsChown() in src/c++/libhdfs/hdfs.c has this
      ----------
      ...
      if (owner == NULL && group == NULL)

      { fprintf(stderr, "Both owner and group cannot be null in chown"); errno = EINVAL; return -1; }

      ...
      ----------

      and also, setOwner seems allowing NULL
      ----------
      username - If it is null, the original username remains unchanged.
      groupname - If it is null, the original groupname remains unchanged.
      ----------
      according to the api document.

      therefore, I think fuse_impls_chown.c should not treat only user(or only group) lookup fail as an error.

      1. HDFS-1249.001.patch
        5 kB
        Colin Patrick McCabe
      2. HDFS-1249.002.patch
        6 kB
        Colin Patrick McCabe
      3. HDFS1249.1
        0.9 kB
        matsusaka kentaro

        Activity

        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Eli Collins made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 2.2.0-alpha [ 12322472 ]
        Resolution Fixed [ 1 ]
        Colin Patrick McCabe made changes -
        Attachment HDFS-1249.002.patch [ 12536936 ]
        Colin Patrick McCabe made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Colin Patrick McCabe made changes -
        Attachment HDFS-1249.001.patch [ 12536789 ]
        Colin Patrick McCabe made changes -
        Assignee Colin Patrick McCabe [ cmccabe ]
        Jeff Hammerbacher made changes -
        Labels fuse
        matsusaka kentaro made changes -
        Field Original Value New Value
        Attachment HDFS1249.1 [ 12447438 ]
        matsusaka kentaro created issue -

          People

          • Assignee:
            Colin Patrick McCabe
            Reporter:
            matsusaka kentaro
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development