[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <30832.1202206161@redhat.com>
Date: Tue, 05 Feb 2008 10:09:21 +0000
From: David Howells <dhowells@...hat.com>
To: Valdis.Kletnieks@...edu
Cc: dhowells@...hat.com, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: 2.6.24-rc6-mm1 - iget-stop-isofs-from-using-read_inode-fix-2.patch
How about this patch?
David
---
IGET: Fix isofs_get_block() to only return 0 on success.
From: David Howells <dhowells@...hat.com>
Fix isofs_get_block() to return only 0 on success. It shouldn't return a +ve
block count for example.
Also make sure that isofs_get_blocks() doesn't accidentally return an error if
rv is 0 come the return statement.
Signed-off-by: David Howells <dhowells@...hat.com>
---
fs/isofs/inode.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 0f5ed8c..875d37f 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -1022,6 +1022,7 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
rv++;
}
+ error = 0;
abort:
unlock_kernel();
return rv != 0 ? rv : error;
@@ -1033,12 +1034,15 @@ abort:
static int isofs_get_block(struct inode *inode, sector_t iblock,
struct buffer_head *bh_result, int create)
{
+ int ret;
+
if (create) {
printk(KERN_DEBUG "%s: Kernel tries to allocate a block\n", __func__);
return -EROFS;
}
- return isofs_get_blocks(inode, iblock, &bh_result, 1);
+ ret = isofs_get_blocks(inode, iblock, &bh_result, 1);
+ return ret < 0 ? ret : 0;
}
static int isofs_bmap(struct inode *inode, sector_t block)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists