[Btrfs-devel] btrfs and git-reflog

Linus Torvalds torvalds at linux-foundation.org
Fri Jan 25 09:09:05 PST 2008



On Fri, 25 Jan 2008, Chris Mason wrote:
> 
> 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



More information about the Btrfs-devel mailing list