[issue7759] mhlib fails on Btrfs filesystem (test_mhlib failure)

Serhiy Storchaka report at bugs.python.org
Fri Nov 13 17:35:48 EST 2015


Serhiy Storchaka added the comment:

st_nlink is not related to the number of messages in a folder. It is a number of hard links.

If the filesystem supports hard links counting for directories, every directory (except /) has at least two links: one from its parent directory, and one from itself (via "."). Every subdirectory adds yet one hard link via "..". Non-directory files don't create hard links.

Typical mail folder can contain thousands of messages and none or only a few subfolders. Subfolders (if there are any) usually are created before messages and hence encountered first in directory listing. Hereby the optimization can have significant effect.

If there is a real case when st_nlink != 1 and is less then a number of subdirectories + 2, we should consider removing the optimization.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7759>
_______________________________________


More information about the Python-bugs-list mailing list