git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
fs
/
cramfs
/
inode.c
diff --git
a/fs/cramfs/inode.c
b/fs/cramfs/inode.c
index
abc60b7
..
6db03fb
100644
(file)
--- a/
fs/cramfs/inode.c
+++ b/
fs/cramfs/inode.c
@@
-241,11
+241,10
@@
static int cramfs_fill_super(struct super_block *sb, void *data, int silent)
sb->s_flags |= MS_RDONLY;
sb->s_flags |= MS_RDONLY;
- sbi = k
m
alloc(sizeof(struct cramfs_sb_info), GFP_KERNEL);
+ sbi = k
z
alloc(sizeof(struct cramfs_sb_info), GFP_KERNEL);
if (!sbi)
return -ENOMEM;
sb->s_fs_info = sbi;
if (!sbi)
return -ENOMEM;
sb->s_fs_info = sbi;
- memset(sbi, 0, sizeof(struct cramfs_sb_info));
/* Invalidate the read buffers on mount: think disk change.. */
mutex_lock(&read_mutex);
/* Invalidate the read buffers on mount: think disk change.. */
mutex_lock(&read_mutex);
@@
-339,7
+338,7
@@
static int cramfs_statfs(struct dentry *dentry, struct kstatfs *buf)
*/
static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
*/
static int cramfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
- struct inode *inode = filp->f_dentry->d_inode;
+ struct inode *inode = filp->f_
path.
dentry->d_inode;
struct super_block *sb = inode->i_sb;
char *buf;
unsigned int offset;
struct super_block *sb = inode->i_sb;
char *buf;
unsigned int offset;
@@
-482,6
+481,8
@@
static int cramfs_readpage(struct file *file, struct page * page)
pgdata = kmap(page);
if (compr_len == 0)
; /* hole */
pgdata = kmap(page);
if (compr_len == 0)
; /* hole */
+ else if (compr_len > (PAGE_CACHE_SIZE << 1))
+ printk(KERN_ERR "cramfs: bad compressed blocksize %u\n", compr_len);
else {
mutex_lock(&read_mutex);
bytes_filled = cramfs_uncompress_block(pgdata,
else {
mutex_lock(&read_mutex);
bytes_filled = cramfs_uncompress_block(pgdata,
@@
-544,8
+545,15
@@
static struct file_system_type cramfs_fs_type = {
static int __init init_cramfs_fs(void)
{
static int __init init_cramfs_fs(void)
{
- cramfs_uncompress_init();
- return register_filesystem(&cramfs_fs_type);
+ int rv;
+
+ rv = cramfs_uncompress_init();
+ if (rv < 0)
+ return rv;
+ rv = register_filesystem(&cramfs_fs_type);
+ if (rv < 0)
+ cramfs_uncompress_exit();
+ return rv;
}
static void __exit exit_cramfs_fs(void)
}
static void __exit exit_cramfs_fs(void)