mirror of
https://github.com/torvalds/linux
synced 2024-09-22 12:26:27 +00:00
[XFS] link(2) on directory is banned in VFS.
SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:26293a Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
This commit is contained in:
parent
eb99adde31
commit
b71d300c8b
|
@ -2603,8 +2603,7 @@ xfs_link(
|
||||||
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
|
vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address);
|
||||||
|
|
||||||
target_namelen = VNAMELEN(dentry);
|
target_namelen = VNAMELEN(dentry);
|
||||||
if (VN_ISDIR(src_vp))
|
ASSERT(!VN_ISDIR(src_vp));
|
||||||
return XFS_ERROR(EPERM);
|
|
||||||
|
|
||||||
sip = xfs_vtoi(src_vp);
|
sip = xfs_vtoi(src_vp);
|
||||||
tdp = XFS_BHVTOI(target_dir_bdp);
|
tdp = XFS_BHVTOI(target_dir_bdp);
|
||||||
|
@ -2699,9 +2698,8 @@ xfs_link(
|
||||||
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
|
xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE);
|
||||||
|
|
||||||
error = xfs_bumplink(tp, sip);
|
error = xfs_bumplink(tp, sip);
|
||||||
if (error) {
|
if (error)
|
||||||
goto abort_return;
|
goto abort_return;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If this is a synchronous mount, make sure that the
|
* If this is a synchronous mount, make sure that the
|
||||||
|
@ -2719,9 +2717,8 @@ xfs_link(
|
||||||
}
|
}
|
||||||
|
|
||||||
error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
|
error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL);
|
||||||
if (error) {
|
if (error)
|
||||||
goto std_return;
|
goto std_return;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fall through to std_return with error = 0. */
|
/* Fall through to std_return with error = 0. */
|
||||||
std_return:
|
std_return:
|
||||||
|
@ -2742,6 +2739,8 @@ xfs_link(
|
||||||
xfs_trans_cancel(tp, cancel_flags);
|
xfs_trans_cancel(tp, cancel_flags);
|
||||||
goto std_return;
|
goto std_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xfs_mkdir
|
* xfs_mkdir
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue