From 087387f90f577f5a0ab68d33ef326c9bb6d80dda Mon Sep 17 00:00:00 2001 From: Akinobu Mita Date: Thu, 14 Sep 2006 09:22:38 -0500 Subject: [PATCH] JFS: return correct error when i-node allocation failed I have seen confusing behavior on JFS when I injected many intentional slab allocation errors. The cp command failed with no disk space error with enough disk space. This patch makes: - change the return value in case slab allocation failures happen from -ENOSPC to -ENOMEM - ialloc() return error code so that the caller can know the reason of failures Signed-off-by: Akinobu Mita Signed-off-by: Dave Kleikamp (cherry picked from 2b46f77976f798f3fe800809a1d0ed38763c71c8 commit) --- fs/jfs/jfs_dtree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/jfs/jfs_dtree.c') diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 6c3f0831984..a9f2604f28c 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -3780,13 +3780,13 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp, lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_KERNEL); if (lkey.name == NULL) - return -ENOSPC; + return -ENOMEM; rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_KERNEL); if (rkey.name == NULL) { kfree(lkey.name); - return -ENOSPC; + return -ENOMEM; } /* get left and right key */ -- cgit v1.2.3