<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVEuPozgQ_jXkYiUiJgnkwKEf21IfRhpNr_ZuoAjeGMzYptn8-_3KkBlNNLeR8gC7XPU9qlzZ5lYWJ5KqLdJDVue5LPJ9qvL9vjrJrJX5QR6LdK-yU50JpXtqRLBidOTJfZIIHQnr9EUPyiTpa5I-OTIqaGyNKnRi7mgQrTJGDxdRqfrKp_kQ_RfI4ZBotSF_84H6nXieQjyxZEKYo0TmXgyE_UYkp_QbNdpRHZDuDQc_4kGPDSTVXgDWZIIXeliQTSiy7a0PS8Z_3j6E_SQ3O80ZYkyEaVuhhLEzOYGY3RK9_L5ZB7CqHw2wvIigroTYBYV1N5Ts1ThyNs5s1I2TAdCT2CbZX-KZsamhwdcyoSXpEvK8hLxwyMxkRYUY0Smoh7XJ0_Yu03ZQPUWensJOvC8lEvnWWsur2t_V_z4tYkU9Zm2MAL6HaHjA5R8XXn4sMNNqNSNmumdneUE5TG7wdysfyEJAPq7DUj1wiijSPfgjqDD5VZdV6lPKdv4Wmx7AR8F9WTjFEiKPGsSVKKqOOso_oj__YuH7IqmC1y5o9NzXb2IaAQ9ie9sTSui4rhviXLLoQhh9krFk-Dj61DT7nTGf_c66C5Ze9_s8z7hS1AkgfGC2A1GziqVEhWU4PVt3FVvhR6p1q2sMw41Z9txJLImHtaIGpwuJFt0WIcVmET2FzjYehmMOeoEWEn4asdGh525LnUgDlRA5XUBIDzUhchYzDw-aKpEwjqviQRhS13vrz6RdA_LrJDYUlDaeIf92zNbWZbrDav3T13eWi_s7ErhnxvqjCX93KrDwyngL-H6hGdCsng0FMeA30ebOjtROEfD5p0za-4lNNDoEA8HAxJHbbZoya87ZWW3UBAlcWQ2Vcp3qN5Mz5a9GXiDVVO1q2-OF3Vz_tqOz_4IuXmMVj4djlqWnTVdKSfLQ0uFUyTNVbXuWVVHnlNKRTukhzTZGVWR8mRzRs3KgeQGK5-T4uvlzBLqUqZTpXqZpmhXZYSebgqiocpnWlFcHmRxSTJc2P9pz48qYspouHptGQ-Kfm8p7fUGbRsBAGDTULL9grjWuuPsl5u_tipskNhjGaqs_W7_u82ACcjPVPD21ddwt612II3yp-k1kUkYa_wO3hxcu>53306</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Multiple overlays specified with `-ivfsoverlay` produce incorrect remapped paths
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          bnbarham
      </td>
    </tr>
</table>

<pre>
    86e2af8043c7728710a711b623f27425801a36c3 aimed to preserve the original
relative path when falling back to the external filesystem. But when
there's nested `RedirectingFileSystems` this results in the outer-most
VFS overwriting the path of a lower VFS.

For example, take a directory remapping overlay of `A -> B` and another
of `B -> C` where both have `use-external-names` set. If `A/foo` is
requested this will map `A/foo` to `B/foo` to `C/foo`, but when this
result returns to the `A -> B` VFS, it will then remap the `Status` and
`File` to `B/foo` instead (rather than keeping it as `C/foo`).

I have a partial PR up with some initial ideas (https://reviews.llvm.org/D117730) but it still needs
a bit of work - specifically to make the same change for some other methods. I'm not super happy
with it though since now we're *really* leaking the weird internal details of RedirectingFileSystem
out into the API (and changing the API).

That PR also has some tests that should (hopefully) make the issue a little clearer.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtVE2vozgQ_DXkYiVyIIHkwOF97JPeYaXRvNXeDTTBG4NZ24TNv99qQ2Y00Uj5IHa7uqq6nMo29_KUU6rakzxkdVGkp2IvVbHfV3matWlxSI8nuVdZXmdC6Z4aEawYHXlyNxKhI2GdvuhBmUS-J_LFkVFBY2tUoRNzR4NolTF6uIhK1Vc-zYfov0AOh0SrDfm7D9TvxOsU4okFCWWOkrTwYiDsNyLJ5XdqtKM6AO4DB7_iQY8NgGovQGsywQs9LMwmNNn21ocF8e-PL2Fv5GanGSHWR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