Re: [PATCH v1 2/7] mv: add documentation for check_dir_in_index()

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

 



On 7/20/2022 1:43 AM, Derrick Stolee wrote:
>> + *
>> + * Note: *always* check the directory is not on-disk before this function
>> + * (i.e. using lstat());
>> + * otherwise it may return a false positive for a partially sparsified
>> + * directory.
>
> I'm not sure what you mean by a "false positive" in this case.
> The directory exists in the index, which is what the method is
> defined as checking. This does not say anything about the
> worktree.
>
> Perhaps that's the real problem? Someone might interpret this
> as meaning the directory does not exist in the worktree? That
> would mean that this doc update needs to be changed significantly
> to say "Note that this does not imply anything about the state
> of the worktree" or something.

This method assumes that the directory being checking does not exist
in the working tree, but the method itself does not check this. And
if the user does not make sure the directory is absent from the
worktree, this method may return a success for a partially sparsified
directory, which is not intended.

> But I think I'd rather just see this patch be dropped, unless I
> am missing something important.

I found Victoria's paraphrase [1] makes my point much clearer.

--
Thanks,
Shaoxuan




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux