From: Linus Torvalds Date: Fri, 25 Jan 2008 17:09:05 GMT Subject: Re: [Btrfs-devel] btrfs and git-reflog Message-ID: In-Reply-To: <200801251050.16697.chris.mason@oracle.com> 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