pull mnt_want_write()/mnt_drop_write() into kern_path_create()/done_path_create() resp.
One side effect - attempt to create a cross-device link on a read-only fs fails with EROFS instead of EXDEV now. Makes more sense, POSIX allows, etc. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -4466,16 +4466,9 @@ int ocfs2_reflink_ioctl(struct inode *inode,
|
||||
goto out_dput;
|
||||
}
|
||||
|
||||
error = mnt_want_write(new_path.mnt);
|
||||
if (error) {
|
||||
mlog_errno(error);
|
||||
goto out_dput;
|
||||
}
|
||||
|
||||
error = ocfs2_vfs_reflink(old_path.dentry,
|
||||
new_path.dentry->d_inode,
|
||||
new_dentry, preserve);
|
||||
mnt_drop_write(new_path.mnt);
|
||||
out_dput:
|
||||
done_path_create(&new_path, new_dentry);
|
||||
out:
|
||||
|
Reference in New Issue
Block a user