git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Chris MasonNext: Junio C Hamano
Message 5 of 10 in “btrfs and git-reflog”
  1. Paul CollinsJan 25, 2008
  2. Paul CollinsJan 25, 2008
  3. Chris MasonJan 25, 2008
  4. Chris MasonJan 25, 2008
  5. Linus TorvaldsJan 25, 2008
  6. Junio C HamanoJan 25, 2008
  7. Junio C HamanoJan 26, 2008
  8. Linus TorvaldsJan 27, 2008
  9. Junio C HamanoJan 27, 2008
  10. reflog-expire: Avoid creating new files in a directory inside readdir(3) loopJunio C Hamano, Jan 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.