Re: [Btrfs-devel] btrfs and git-reflog
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Jan 25, 2008, 17:09 UTC
- Message-ID
- <alpine.LFD.1.00.0801250905570.14161@hp.linux-foundation.org>
- In-Reply-To
- <200801251050.16697.chris.mason@oracle.com>
On Fri, 25 Jan 2008, Chris Mason wrote:
Show 5 quoted lines
> > The btrfs patch below changes my readdir code to force the > directory f_pos field to the max offset allowed when we've > seen all the directory entries. This prevents the readdir > call from looping forever in the face of newly added files.
I think such a change may be sensible if we also taught the Linux VFS layer about it (so that we could avoid the costly parts of readdir() getting a semaphore etc the next call), but in this particular format it's just an ugly hack for what is a git bug.
> But, git might want to add some checks to see if it has > already processed things.
Yes indeed. This is clearly git mis-using "readdir()", and should be fixed. It could happen on other filesystems, and very much including ones where there is no option of just "fixing" the filesystem (including Linux: not everybody can upgrade their kernels just because git makes some broken assumptions).
Linus