Re: Mass-Hardlinking Oops

Matteo Frigo
2009-10-14T00:29:02Z

Chris Mason <chris.mason@oracle.com> writes:

> Please keep in mind this is only a limit on the number of links to a
> single file where the links and the file are all in the same directory.

For the record, the nnmaildir mail backend in Gnus (an Emacs package
for reading news and email) creates multiple hardlinks to the same
file in the same directory. I had several thousands hardlinks at one
time.

Gnus/nnmaildir uses hardlinks to keep track of attributes of email
messages. For example, to denote that the email stored in file FOO
has been read, nnmaildir creates a link called marks/read/FOO, linking
to an empty file. The rationale for this mechanism is that 1) you
don't want to modify the email message itself; 2) storing marks in
separate files allows concurrent accesses to the mail spool without
locking; and 3) using a hardlink rather than a new empty file saves an
inode.

I am not saying that what Gnus does is particularly smart, but this is
an example of a real world application that may break under btrfs.

Regards,
Matteo Frigo