Re: [Btrfs-devel] btrfs and git-reflog

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

 



Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> writes:

> Yes, but the potential problem is actually very different:
>
>  - directory contains 'a', 'b' and 'c'
>
> 	* opendir()
> 	* readdir() returns 'a'
> 	  * unlink('a');
> 	* readdir() returns 'c', having skipped 'b'.
>
> This is something that could in theory happen if a directory is indexed 
> using the *position* of a filename in a directory. 'a' was position 1, 'b' 
> was position 2, and 'c' was position 3. After the first readdir(), the 
> file position was 2 (pointing at 'b'), but when we removed 'a', the other 
> entries positions moved down, and now 'b' is at position 1, and 'c' is at 
> position '2'. When we call readdir() the next time, it skips 'b' (because 
> it already returned position 1!), and returns 'c'.
>
> See?

Yes, I had that one in mind too, but that will cause us to miss
'b' and its only effect is to leave 'b' unpacked.  If we somehow
dropped 'b' and lost information that is a different story, but
I do not think this failure mode would cause our current code to
do so.  So I do not think is a big deal even if some filesystem
had a bug like that.


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

[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