Author: tomwhite
Date: Wed Mar 10 22:24:59 2010
New Revision: 921596
URL: http://svn.apache.org/viewvc?rev=921596&view=rev
Log:
HDFS-858. Incorrect return codes for fuse-dfs. Contributed by Brian Bockelman.
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_open.c
hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_write.c
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=921596&r1=921595&r2=921596&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Wed Mar 10 22:24:59 2010
@@ -182,6 +182,9 @@ Trunk (unreleased changes)
HDFS-857. Incorrect type for fuse-dfs capacity can cause "df" to return
negative values on 32-bit machines. (Brian Bockelman via tomwhite)
+ HDFS-858. Incorrect return codes for fuse-dfs. (Brian Bockelman via
+ tomwhite)
+
Release 0.21.0 - Unreleased
INCOMPATIBLE CHANGES
Modified: hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_open.c
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_open.c?rev=921596&r1=921595&r2=921596&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_open.c (original)
+++ hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_open.c Wed Mar 10
22:24:59 2010
@@ -52,7 +52,11 @@ int dfs_open(const char *path, struct fu
if ((fh->hdfsFH = hdfsOpenFile(fh->fs, path, flags, 0, 0, 0)) == NULL) {
syslog(LOG_ERR, "ERROR: could not connect open file %s:%d\n", __FILE__,
__LINE__);
- return -EIO;
+ syslog(LOG_ERR, "ERROR: errno %d\n", errno);
+ if (errno == 0 || errno == EINTERNAL) {
+ return -EIO;
+ }
+ return -errno;
}
//
Modified: hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_write.c
URL:
http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_write.c?rev=921596&r1=921595&r2=921596&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_write.c (original)
+++ hadoop/hdfs/trunk/src/contrib/fuse-dfs/src/fuse_impls_write.c Wed Mar 10
22:24:59 2010
@@ -53,15 +53,21 @@ int dfs_write(const char *path, const ch
tOffset cur_offset = hdfsTell(fh->fs, file_handle);
if (cur_offset != offset) {
syslog(LOG_ERR, "ERROR: user trying to random access write to a file
%d!=%d for %s %s:%d\n",(int)cur_offset, (int)offset,path, __FILE__, __LINE__);
- ret = -EIO;
+ ret = -ENOTSUP;
} else {
length = hdfsWrite(fh->fs, file_handle, buf, size);
if (length <= 0) {
- syslog(LOG_ERR, "ERROR: fuse problem - could not write all the bytes for
%s %d!=%d%s:%d\n",path,length,(int)size, __FILE__, __LINE__);
- ret = -EIO;
+ syslog(LOG_ERR, "ERROR: could not write all the bytes for %s
%d!=%d%s:%d\n", path, length, (int)size, __FILE__, __LINE__);
+ syslog(LOG_ERR, "ERROR: errno %d\n", errno);
+ if (errno == 0 || errno == EINTERNAL) {
+ ret = -EIO;
+ } else {
+ ret = -errno;
+ }
}
if (length != size) {
- syslog(LOG_ERR, "WARN: fuse problem - could not write all the bytes for
%s %d!=%d%s:%d\n",path,length,(int)size, __FILE__, __LINE__);
+ syslog(LOG_ERR, "ERROR: could not write all the bytes for %s
%d!=%d%s:%d\n", path, length, (int)size, __FILE__, __LINE__);
+ syslog(LOG_ERR, "ERROR: errno - %d\n", errno);
}
}