Re: [PATCH 2/3] ovl: set origin xattr for merge dir on lookup

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

 



On 2017/11/8 21:30, Amir Goldstein Wrote:
> On Wed, Nov 8, 2017 at 10:27 AM, Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>> On Wed, Nov 8, 2017 at 8:59 AM, zhangyi (F) <yi.zhang@xxxxxxxxxx> wrote:
>>> On 2017/11/8 5:38, Amir Goldstein Wrote:
>>>> For old existing merge dirs whose "origin" xattr was not set at copy up
>>>> time, we amend the situation on lookup.
>>>>
>>>> If no origin fh is stored in upper of a merge dir, store fh of upper most
>>>> lower dir or 'null' fh if lower does not support file handles. We do this
>>>> so we can filter out whiteouts in case lower dir is removed offline and
>>>> then upper dir becomes a pure upper in a future mount.
>>>>
>>>> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>>>> ---
> [...]
>>
>>> At the same time, consider the opposite side, all directories move from a base filesystem which 'file
>>> handle' supported to a not supported one. It will trigger NULL pointer crash in ovl_verify_origin_fh()
>>> because fh is NULL but ofh was existed. Following change good ?
>>>
>>> -       if (!ofh)
>>> +       if (!ofh || !fh)
>>>                 return -ENODATA;
>>>
>>
>> Thanks for pointing that out, but change is not good because it looses the
>> information about finding a stored null_fh.
>> If we do want to stick with ovl_null_fh trick, I could pass in &ovl_null_fh
>> instead of NULL, in case of !ovl_can_decode_fh(origin->d_sb).
>> This fixes the NULL pointer crash and I can remove this special case,
> 
> Zhangyi,
> 
> I pushed a fix rebased on overlayfs-next from today to
> https://github.com/amir73il/linux/commits/ovl-whiteouts
> 
> Tested it with xfs and with xfs without uuid (test patch).

Hi Amir:

Sorry for the late, I prefer to use ovl_null_fh too, this patch looks good to me.

> I did not test the migration cases that you listed.

As far as know, docker container migration will tar all things in upper to lower layer,
may be I thought to much and we may no need to deal with this case now.

Thanks,
Yi.

> Please review.
> Thanks,
> Amir.
> 

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



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux