mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-30 01:47:56 +03:00
o Fixed infinite loop in parser
o Fixed error handling whilst creating volumes o General tidy up
This commit is contained in:
parent
a381c45a6e
commit
fc4a099514
@ -48,6 +48,7 @@ void dmfs_zap_errors(struct dm_table *t)
|
||||
|
||||
while(!list_empty(&t->errors)) {
|
||||
e = list_entry(t->errors.next, struct dmfs_error, list);
|
||||
list_del(&e->list);
|
||||
kfree(e);
|
||||
}
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ struct dentry *dmfs_verify_name(struct inode *dir, const char *name)
|
||||
|
||||
memset(&file, 0, sizeof(struct file));
|
||||
|
||||
if (path_init(name, LOOKUP_FOLLOW, &nd))
|
||||
if (!path_init(name, LOOKUP_FOLLOW, &nd))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
err = path_walk(name, &nd);
|
||||
@ -115,8 +115,8 @@ static int dmfs_lv_symlink(struct inode *dir, struct dentry *dentry,
|
||||
return PTR_ERR(de);
|
||||
|
||||
inode = dmfs_create_symlink(dir, S_IRWXUGO);
|
||||
if (IS_ERR(inode)) {
|
||||
rv = PTR_ERR(inode);
|
||||
if (inode == NULL) {
|
||||
rv = -ENOSPC;
|
||||
goto out_allow_write;
|
||||
}
|
||||
|
||||
@ -136,7 +136,6 @@ static int dmfs_lv_symlink(struct inode *dir, struct dentry *dentry,
|
||||
return rv;
|
||||
|
||||
out_dput:
|
||||
dput(DMFS_I(inode)->dentry);
|
||||
DMFS_I(inode)->dentry = NULL;
|
||||
out_allow_write:
|
||||
{
|
||||
@ -266,9 +265,9 @@ struct inode *dmfs_create_lv(struct super_block *sb, int mode, struct dentry *de
|
||||
memcpy(tmp_name, name, dentry->d_name.len);
|
||||
tmp_name[dentry->d_name.len] = 0;
|
||||
md = dm_create(tmp_name, -1);
|
||||
if (md == NULL) {
|
||||
if (IS_ERR(md)) {
|
||||
iput(inode);
|
||||
return NULL;
|
||||
return ERR_PTR(PTR_ERR(md));
|
||||
}
|
||||
DMFS_I(inode)->md = md;
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ static void dmfs_parse_line(struct dm_table *t, unsigned num, char *str)
|
||||
rv = ttype->ctr(t, start, size, p, &context);
|
||||
msg = context;
|
||||
if (rv == 0) {
|
||||
printk(KERN_DEBUG "%ul %ul %s %s", start, size,
|
||||
printk("dmfs_parse: %ul %ul %s %s\n", start, size,
|
||||
ttype->name,
|
||||
ttype->print ? ttype->print(context) : "-");
|
||||
msg = "Error adding target to table";
|
||||
@ -183,7 +183,7 @@ static struct dm_table *dmfs_parse(struct inode *inode)
|
||||
}
|
||||
|
||||
index++;
|
||||
} while(index != end_index);
|
||||
} while(index <= end_index);
|
||||
|
||||
free_page(page);
|
||||
if (dm_table_complete(t) == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user