Skip to contentSkip to conversation

JFS: diAlloc() should return -EIO rather than EIO

PATCH In review Li Zefan 2 participants 2 messages May 27, 2008 – May 28, 2008 JFS filesystem

lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 JFS: diAlloc() should return -EIO rather than EIO

The comment above the function says one of its return value is -EIO, and also the caller of diAlloc() checks for -EIO:

struct inode *ialloc(struct inode *parent, umode_t mode)

{
	...
	rc = diAlloc(parent, S_ISDIR(mode), inode);
	if (rc) {
		jfs_warn("ialloc: diAlloc returned %d!", rc);
		if (rc == -EIO)
			make_bad_inode(inode);
	...
---
 fs/jfs/jfs_imap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jfs/jfs_imap.c +1 -1
index 734ec91..d6363d8 100644
@@ -1520,7 +1520,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
 					jfs_error(ip->i_sb,
 						  "diAlloc: can't find free bit "
 						  "in wmap");
-					return EIO;
+					return -EIO;
 				}
 
 				/* determine the inode number within the

-- 1.5.4.rc3

#1 lore raw
Quoted 13 lines · Li Zefan

The comment above the function says one of its return value is -EIO, and also the caller of diAlloc() checks for -EIO:

struct inode *ialloc(struct inode *parent, umode_t mode)

{
	...
	rc = diAlloc(parent, S_ISDIR(mode), inode);
	if (rc) {
		jfs_warn("ialloc: diAlloc returned %d!", rc);
		if (rc == -EIO)
			make_bad_inode(inode);
	...
Quoted 1 line
Quoted 9 lines
---
 fs/jfs/jfs_imap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jfs/jfs_imap.c +0 -0
index 734ec91..d6363d8 100644

fs/jfs/jfs_imap.c int diAlloc(struct inode *pip, bool dir, struct inode *ip)

Quoted 9 lines
fs/jfs/jfs_imap.c +1 -2
@@ -1520,7 +1520,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
 					jfs_error(ip->i_sb,
 						  "diAlloc: can't find free bit "
 						  "in wmap");
-					return EIO;
+					return -EIO;
 				}
 
 				/* determine the inode number within the
-- 1.5.4.rc3

I'm not sure how this one escaped detection this long. I've added this patch to the jfs git tree.

Thanks,
Shaggy

Signature · 2 lines
David Kleikamp
IBM Linux Technology Center