int namelen;
int mod = 0;
+ if (root->fs_info->sb->s_flags & MS_RDONLY)
+ return -EROFS;
+
vol_args = kmalloc(sizeof(*vol_args), GFP_NOFS);
if (!vol_args)
int namelen;
int ret;
+ if (root->fs_info->sb->s_flags & MS_RDONLY)
+ return -EROFS;
+
vol_args = kmalloc(sizeof(*vol_args), GFP_NOFS);
if (!vol_args)
{
struct inode *inode = fdentry(file)->d_inode;
struct btrfs_root *root = BTRFS_I(inode)->root;
+ int ret;
+
+ ret = mnt_want_write(file->f_path.mnt);
+ if (ret)
+ return ret;
switch (inode->i_mode & S_IFMT) {
case S_IFDIR:
struct btrfs_ioctl_vol_args *vol_args;
int ret;
+ if (root->fs_info->sb->s_flags & MS_RDONLY)
+ return -EROFS;
+
vol_args = kmalloc(sizeof(*vol_args), GFP_NOFS);
if (!vol_args)
* they don't overlap)?
*/
+ ret = mnt_want_write(file->f_path.mnt);
+ if (ret)
+ return ret;
+
src_file = fget(srcfd);
if (!src_file)
return -EBADF;
goto out;
}
+ ret = mnt_want_write(file->f_path.mnt);
+ if (ret)
+ goto out;
+
mutex_lock(&root->fs_info->trans_mutex);
root->fs_info->open_ioctl_trans++;
mutex_unlock(&root->fs_info->trans_mutex);