Re: [PATCH 18/21] xfs: Add parent pointers to rename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, May 6, 2018 at 8:24 PM, Allison Henderson
<allison.henderson@xxxxxxxxxx> wrote:
> This patch removes the old parent pointer attribute during the
> rename operation, and re-adds the updated parent pointer
>
> Signed-off-by: Allison Henderson <allison.henderson@xxxxxxxxxx>
> ---
>  fs/xfs/xfs_inode.c | 68 +++++++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 52 insertions(+), 16 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index b18b20c..7fd1479 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3004,6 +3004,8 @@ xfs_rename(
>         bool                    src_is_directory = S_ISDIR(VFS_I(src_ip)->i_mode);
>         int                     spaceres;
>         int                     error;
> +       xfs_dir2_dataptr_t      new_diroffset;
> +       xfs_dir2_dataptr_t      old_diroffset;
>
>         trace_xfs_rename(src_dp, target_dp, src_name, target_name);
>
> @@ -3058,14 +3060,14 @@ xfs_rename(
>          * we can rely on either trans_commit or trans_cancel to unlock
>          * them.
>          */
> -       xfs_trans_ijoin(tp, src_dp, XFS_ILOCK_EXCL);
> +       xfs_trans_ijoin(tp, src_dp, 0);
>         if (new_parent)
> -               xfs_trans_ijoin(tp, target_dp, XFS_ILOCK_EXCL);
> -       xfs_trans_ijoin(tp, src_ip, XFS_ILOCK_EXCL);
> +               xfs_trans_ijoin(tp, target_dp, 0);
> +       xfs_trans_ijoin(tp, src_ip, 0);
>         if (target_ip)
> -               xfs_trans_ijoin(tp, target_ip, XFS_ILOCK_EXCL);
> +               xfs_trans_ijoin(tp, target_ip, 0);
>         if (wip)
> -               xfs_trans_ijoin(tp, wip, XFS_ILOCK_EXCL);
> +               xfs_trans_ijoin(tp, wip, 0);
>
>         /*
>          * If we are using project inheritance, we only allow renames
> @@ -3075,17 +3077,18 @@ xfs_rename(
>         if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) &&
>                      (xfs_get_projid(target_dp) != xfs_get_projid(src_ip)))) {
>                 error = -EXDEV;
> -               goto out_trans_cancel;
> +               goto out_unlock;
>         }
>
>         xfs_defer_init(&dfops, &first_block);
>
>         /* RENAME_EXCHANGE is unique from here on. */
> -       if (flags & RENAME_EXCHANGE)
> -               return xfs_cross_rename(tp, src_dp, src_name, src_ip,
> +       if (flags & RENAME_EXCHANGE) {
> +               error = xfs_cross_rename(tp, src_dp, src_name, src_ip,
>                                         target_dp, target_name, target_ip,
>                                         &dfops, &first_block, spaceres);
> -
> +               goto out;

What about updating parent pointers in xfs_cross_rename()?

Thanks,
Amir.
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux