Skip to contentSkip to conversation

ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.

PATCH New Jeff Liu 3 participants 3 messages Feb 9, 2012 – Jul 4, 2012 OCFS2

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH 1/1 ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.

Hello,

Since ENXIO only means "offset beyond EOF" for SEEK_DATA/SEEK_HOLE,
Hence we should return the internal error unchanged if ocfs2_inode_lock() or ocfs2_get_clusters_nocache() call failed rather than ENXIO.
Otherwise, it will confuse the user applications when they trying to understand the root cause.

Thanks Dave for pointing this out.

Thanks,
-Jeff

Cc Dave Chinner <[email protected]>
---
 fs/ocfs2/extent_map.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/ocfs2/extent_map.c +0 -2
index 2f5b92e..70b5863 100644
@@ -923,8 +923,6 @@ out_unlock:
 
 	ocfs2_inode_unlock(inode, 0);
 out:
-	if (ret && ret != -ENXIO)
-		ret = -ENXIO;
 	return ret;
 }
 
Signature · 1 line
1.7.9
#1 lore raw

PATCH 1/1 ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.

Quoted 33 lines · Jeff Liu

Hello,

Since ENXIO only means "offset beyond EOF" for SEEK_DATA/SEEK_HOLE,
Hence we should return the internal error unchanged if ocfs2_inode_lock() or ocfs2_get_clusters_nocache() call failed rather than ENXIO.
Otherwise, it will confuse the user applications when they trying to understand the root cause.

Thanks Dave for pointing this out.

Thanks,
-Jeff

Cc Dave Chinner<[email protected]>
---
  fs/ocfs2/extent_map.c |    2 --
  1 files changed, 0 insertions(+), 2 deletions(-)
fs/ocfs2/extent_map.c +0 -2
index 2f5b92e..70b5863 100644
@@ -923,8 +923,6 @@ out_unlock:
 
  	ocfs2_inode_unlock(inode, 0);
  out:
-	if (ret&&  ret != -ENXIO)
-		ret = -ENXIO;
  	return ret;
  }
 
maintainer
#2 lore raw

PATCH 1/1 ocfs2: for SEEK_DATA/SEEK_HOLE, return internal error unchanged if ocfs2_get_clusters_nocache() or ocfs2_inode_lock() call failed.

In reply to Jeff Liu
Quoted 7 lines · Jeff Liu

Hello,

Since ENXIO only means "offset beyond EOF" for SEEK_DATA/SEEK_HOLE,
Hence we should return the internal error unchanged if ocfs2_inode_lock() or ocfs2_get_clusters_nocache() call failed rather than ENXIO.
Otherwise, it will confuse the user applications when they trying to understand the root cause.

Quoted 8 lines

Thanks Dave for pointing this out.

Thanks,
-Jeff

Cc Dave Chinner <[email protected]>

This patch is now (finally) part of the 'fixes' branch of ocfs2.git.

Joel

Quoted 25 lines
---
 fs/ocfs2/extent_map.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
fs/ocfs2/extent_map.c +0 -2
index 2f5b92e..70b5863 100644
@@ -923,8 +923,6 @@ out_unlock:
 
 	ocfs2_inode_unlock(inode, 0);
 out:
-	if (ret && ret != -ENXIO)
-		ret = -ENXIO;
 	return ret;
 }
 
Signature · 6 lines
1.7.9

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel
Signature · 6 lines
"Nearly all men can stand adversity, but if you really want to
 test a man's character, give him power."
	- Abraham Lincoln

			http://www.jlbec.org/
			jlbec at evilplan.org