Author larry
Recipients larry
Date 2013-08-09.04:55:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The getxattr() system call retrieves an "extended attribute" on a file.  When you call it you pass in a buffer and a size.  The expected behavior is, if you pass in a buffer that's too small, the function returns -1 and sets errno to ERANGE.

On a ZFS filesystem on Linux, using the "ZFS On Linux" port:

getxattr() does not behave this way.  Instead, it fills the buffer with the first buffer-size bytes of data (without a zero terminator).

Python's implementation of getxattr() interprets this as success.  Which means that, the way it's implemented, if you call getxattr() to retrieve a value that's > 128 bytes in length, you only get the first 128 bytes.  (Happily, we already have a regression test that finds this!)

Attached is a patch fixing this behavior.  It checks the return value of getxattr() to see if the buffer was filled to 100%.  If so, it retries with a larger buffer.
Date User Action Args
2013-08-09 04:55:33larrysetrecipients: + larry
2013-08-09 04:55:33larrysetmessageid: <>
2013-08-09 04:55:33larrylinkissue18694 messages
2013-08-09 04:55:33larrycreate