diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-06-26 22:45:17 -0400 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2006-06-26 22:45:17 -0400 |
commit | b71d300c8bc0f3617eef4a9c96aebbadeb259177 (patch) | |
tree | 5ebb60087ed46a878a82dfcd1707f1c0232a4493 | |
parent | eb99adde31b7d85c67a5e1c2fa5e098e1056dd79 (diff) |
[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>
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 00a6b7dc24a0..23cfa5837728 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2603,8 +2603,7 @@ xfs_link( | |||
2603 | vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); | 2603 | vn_trace_entry(src_vp, __FUNCTION__, (inst_t *)__return_address); |
2604 | 2604 | ||
2605 | target_namelen = VNAMELEN(dentry); | 2605 | target_namelen = VNAMELEN(dentry); |
2606 | if (VN_ISDIR(src_vp)) | 2606 | ASSERT(!VN_ISDIR(src_vp)); |
2607 | return XFS_ERROR(EPERM); | ||
2608 | 2607 | ||
2609 | sip = xfs_vtoi(src_vp); | 2608 | sip = xfs_vtoi(src_vp); |
2610 | tdp = XFS_BHVTOI(target_dir_bdp); | 2609 | tdp = XFS_BHVTOI(target_dir_bdp); |
@@ -2699,9 +2698,8 @@ xfs_link( | |||
2699 | xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); | 2698 | xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); |
2700 | 2699 | ||
2701 | error = xfs_bumplink(tp, sip); | 2700 | error = xfs_bumplink(tp, sip); |
2702 | if (error) { | 2701 | if (error) |
2703 | goto abort_return; | 2702 | goto abort_return; |
2704 | } | ||
2705 | 2703 | ||
2706 | /* | 2704 | /* |
2707 | * If this is a synchronous mount, make sure that the | 2705 | * If this is a synchronous mount, make sure that the |
@@ -2719,9 +2717,8 @@ xfs_link( | |||
2719 | } | 2717 | } |
2720 | 2718 | ||
2721 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL); | 2719 | error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES, NULL); |
2722 | if (error) { | 2720 | if (error) |
2723 | goto std_return; | 2721 | goto std_return; |
2724 | } | ||
2725 | 2722 | ||
2726 | /* Fall through to std_return with error = 0. */ | 2723 | /* Fall through to std_return with error = 0. */ |
2727 | std_return: | 2724 | std_return: |
@@ -2742,6 +2739,8 @@ std_return: | |||
2742 | xfs_trans_cancel(tp, cancel_flags); | 2739 | xfs_trans_cancel(tp, cancel_flags); |
2743 | goto std_return; | 2740 | goto std_return; |
2744 | } | 2741 | } |
2742 | |||
2743 | |||
2745 | /* | 2744 | /* |
2746 | * xfs_mkdir | 2745 | * xfs_mkdir |
2747 | * | 2746 | * |