Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E1B3CDB60 for ; Tue, 17 Jul 2012 07:43:41 +0000 (UTC) Received: (qmail 26638 invoked by uid 500); 17 Jul 2012 07:43:40 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 26235 invoked by uid 500); 17 Jul 2012 07:43:39 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 26128 invoked by uid 99); 17 Jul 2012 07:43:36 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 07:43:36 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 90CF914285A for ; Tue, 17 Jul 2012 07:43:36 +0000 (UTC) Date: Tue, 17 Jul 2012 07:43:36 +0000 (UTC) From: "Colin Patrick McCabe (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <631699264.62662.1342511016595.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (HDFS-1249) with fuse-dfs, chown which only has owner (or only group) argument fails with Input/output error. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-1249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Colin Patrick McCabe updated HDFS-1249: --------------------------------------- Attachment: HDFS-1249.001.patch * fuse_impls_chown.c: handle the case where one or both of the uid/gid are -1, which FUSE uses to indicate "no change." * fuse_impls_chown.c: be more verbose about error codes. Avoid checking errno after potentially clearing it by doing something else. * hdfsChown: don't treat owner == NULL && group == NULL (no change) as an error. It just means no operation was requested, so return success. * Do not call NewStringUTF on a NULL argument. This is not guaranteed to work, although it may with some JVM versions. * hdfs.h: fix header file documentation. We never did anything special with the empty string in hdfsChown-- NULL was always the special value indicating "no change." > with fuse-dfs, chown which only has owner (or only group) argument fails with Input/output error. > ------------------------------------------------------------------------------------------------- > > Key: HDFS-1249 > URL: https://issues.apache.org/jira/browse/HDFS-1249 > Project: Hadoop HDFS > Issue Type: Bug > Components: contrib/fuse-dfs > Affects Versions: 0.20.1, 0.20.2 > Environment: x86 linux (ubuntu 10.04) > Reporter: matsusaka kentaro > Assignee: Colin Patrick McCabe > Priority: Minor > Labels: fuse > Attachments: HDFS-1249.001.patch, HDFS1249.1 > > > 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. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira