[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 03/16] libdiskfs: track file name in struct peropen
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 03/16] libdiskfs: track file name in struct peropen |
Date: |
Thu, 29 Aug 2013 01:05:25 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
I don't understand this part:
Justus Winter, le Tue 30 Jul 2013 11:59:11 +0200, a écrit :
> @@ -100,8 +100,17 @@ diskfs_S_dir_rename (struct protid *fromcred,
> diskfs_nrele (fnp);
> pthread_mutex_unlock (&renamedirlock);
> if (!err)
> - /* MiG won't do this for us, which it ought to. */
> - mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
> + {
> + /* MiG won't do this for us, which it ought to. */
> + mach_port_deallocate (mach_task_self (), tocred->pi.port_right);
> +
> + /* Update fromcred->po->path for anyone who still has a
> + reference to this node. */
> + free (fromcred->po->path);
> + fromcred->po->path = strdup (tocred->po->path);
> + if (! fromcred->po->path)
> + return ENOMEM;
> + }
> return err;
> }
>
> @@ -194,6 +203,13 @@ diskfs_S_dir_rename (struct protid *fromcred,
>
> /* We now hold no locks */
>
> + /* Update fromcred->po->path for anyone who still has a reference to
> + this node. */
> + free (fromcred->po->path);
> + fromcred->po->path = strdup (tocred->po->path);
> + if (! fromcred->po->path)
> + return ENOMEM;
> +
> /* Now we remove the source. Unfortunately, we haven't held
> fdp locked (nor could we), so someone else might have already
> removed it. */
Why is this modifying fromcred? AIUI that is the directory originally
containing the node to be renamed, so I don't see why its path should
change.
Samuel
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH 03/16] libdiskfs: track file name in struct peropen,
Samuel Thibault <=