提交 7f0d384c 编写于 作者: L Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  Minix: Clean up left over label
  fix truncate inode time modification breakage
  fix setattr error handling in sysfs, configfs
  fcntl: return -EFAULT if copy_to_user fails
  wrong type for 'magic' argument in simple_fill_super()
  fix the deadlock in qib_fs
  mqueue doesn't need make_bad_inode()
...@@ -542,10 +542,8 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -542,10 +542,8 @@ static int qibfs_fill_super(struct super_block *sb, void *data, int silent)
list_for_each_entry_safe(dd, tmp, &qib_dev_list, list) { list_for_each_entry_safe(dd, tmp, &qib_dev_list, list) {
spin_unlock_irqrestore(&qib_devs_lock, flags); spin_unlock_irqrestore(&qib_devs_lock, flags);
ret = add_cntr_files(sb, dd); ret = add_cntr_files(sb, dd);
if (ret) { if (ret)
deactivate_super(sb);
goto bail; goto bail;
}
spin_lock_irqsave(&qib_devs_lock, flags); spin_lock_irqsave(&qib_devs_lock, flags);
} }
......
...@@ -1552,7 +1552,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr) ...@@ -1552,7 +1552,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
if (error) if (error)
return error; return error;
} }
if (iattr->ia_valid & ATTR_SIZE) { if (iattr->ia_valid & ATTR_SIZE && iattr->ia_size != inode->i_size) {
error = ext2_setsize(inode, iattr->ia_size); error = ext2_setsize(inode, iattr->ia_size);
if (error) if (error)
return error; return error;
......
...@@ -274,7 +274,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg) ...@@ -274,7 +274,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg)
ret = copy_from_user(&owner, owner_p, sizeof(owner)); ret = copy_from_user(&owner, owner_p, sizeof(owner));
if (ret) if (ret)
return ret; return -EFAULT;
switch (owner.type) { switch (owner.type) {
case F_OWNER_TID: case F_OWNER_TID:
...@@ -332,8 +332,11 @@ static int f_getown_ex(struct file *filp, unsigned long arg) ...@@ -332,8 +332,11 @@ static int f_getown_ex(struct file *filp, unsigned long arg)
} }
read_unlock(&filp->f_owner.lock); read_unlock(&filp->f_owner.lock);
if (!ret) if (!ret) {
ret = copy_to_user(owner_p, &owner, sizeof(owner)); ret = copy_to_user(owner_p, &owner, sizeof(owner));
if (ret)
ret = -EFAULT;
}
return ret; return ret;
} }
......
...@@ -489,7 +489,8 @@ int simple_write_end(struct file *file, struct address_space *mapping, ...@@ -489,7 +489,8 @@ int simple_write_end(struct file *file, struct address_space *mapping,
* unique inode values later for this filesystem, then you must take care * unique inode values later for this filesystem, then you must take care
* to pass it an appropriate max_reserved value to avoid collisions. * to pass it an appropriate max_reserved value to avoid collisions.
*/ */
int simple_fill_super(struct super_block *s, int magic, struct tree_descr *files) int simple_fill_super(struct super_block *s, unsigned long magic,
struct tree_descr *files)
{ {
struct inode *inode; struct inode *inode;
struct dentry *root; struct dentry *root;
......
...@@ -75,10 +75,6 @@ static struct page * dir_get_page(struct inode *dir, unsigned long n) ...@@ -75,10 +75,6 @@ static struct page * dir_get_page(struct inode *dir, unsigned long n)
if (!IS_ERR(page)) if (!IS_ERR(page))
kmap(page); kmap(page);
return page; return page;
fail:
dir_put_page(page);
return ERR_PTR(-EIO);
} }
static inline void *minix_next_entry(void *de, struct minix_sb_info *sbi) static inline void *minix_next_entry(void *de, struct minix_sb_info *sbi)
......
...@@ -2388,7 +2388,7 @@ extern const struct file_operations simple_dir_operations; ...@@ -2388,7 +2388,7 @@ extern const struct file_operations simple_dir_operations;
extern const struct inode_operations simple_dir_inode_operations; extern const struct inode_operations simple_dir_inode_operations;
struct tree_descr { char *name; const struct file_operations *ops; int mode; }; struct tree_descr { char *name; const struct file_operations *ops; int mode; };
struct dentry *d_alloc_name(struct dentry *, const char *); struct dentry *d_alloc_name(struct dentry *, const char *);
extern int simple_fill_super(struct super_block *, int, struct tree_descr *); extern int simple_fill_super(struct super_block *, unsigned long, struct tree_descr *);
extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count); extern int simple_pin_fs(struct file_system_type *, struct vfsmount **mount, int *count);
extern void simple_release_fs(struct vfsmount **mount, int *count); extern void simple_release_fs(struct vfsmount **mount, int *count);
......
...@@ -176,7 +176,6 @@ static struct inode *mqueue_get_inode(struct super_block *sb, ...@@ -176,7 +176,6 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
} }
return inode; return inode;
out_inode: out_inode:
make_bad_inode(inode);
iput(inode); iput(inode);
return NULL; return NULL;
} }
......
...@@ -764,10 +764,11 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end) ...@@ -764,10 +764,11 @@ static void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end)
static int shmem_notify_change(struct dentry *dentry, struct iattr *attr) static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
loff_t newsize = attr->ia_size;
int error; int error;
if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) { if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)
loff_t newsize = attr->ia_size; && newsize != inode->i_size) {
struct page *page = NULL; struct page *page = NULL;
if (newsize < inode->i_size) { if (newsize < inode->i_size) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册