)]}'
{"swift/common/utils.py":[{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"3c48edfb5239c7c5af1c357794c0fb6bf3632d41","unresolved":false,"context_lines":[{"line_number":802,"context_line":"    _fallocate_enabled \u003d False"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"def fallocate(fd, size):"},{"line_number":806,"context_line":"    \"\"\""},{"line_number":807,"context_line":"    Pre-allocate disk space for a file."},{"line_number":808,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_f000b936","line":805,"updated":"2018-04-12 09:33:27.000000000","message":"Could we have offset as a parameter here, with a default of 0? For LOSF we allocate more space to existing files","commit_id":"4e9792ac3f934cbdaa8f37ba4ef9e97d0983e993"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"924da8c93accb7908a68986a6c994d9cb93a5d68","unresolved":false,"context_lines":[{"line_number":802,"context_line":"    _fallocate_enabled \u003d False"},{"line_number":803,"context_line":""},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"def fallocate(fd, size):"},{"line_number":806,"context_line":"    \"\"\""},{"line_number":807,"context_line":"    Pre-allocate disk space for a file."},{"line_number":808,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_533725ff","line":805,"in_reply_to":"bf659307_f000b936","updated":"2018-04-12 16:08:04.000000000","message":"Of course. Sorry for taking that out; I didn\u0027t see any call sites specifying an offset so I assumed it was just for hole-punching.","commit_id":"4e9792ac3f934cbdaa8f37ba4ef9e97d0983e993"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"9604cbf946728c8e069a2dbe36d86d36950c7789","unresolved":false,"context_lines":[{"line_number":869,"context_line":"    if _sys_fallocate.available:"},{"line_number":870,"context_line":"        # Parameters are (fd, mode, offset, length)."},{"line_number":871,"context_line":"        ret \u003d _sys_fallocate("},{"line_number":872,"context_line":"            fd, FALLOC_FL_PUNCH_HOLE, ctypes.c_uint64(offset),"},{"line_number":873,"context_line":"            ctypes.c_uint64(length))"},{"line_number":874,"context_line":"        err \u003d ctypes.get_errno()"},{"line_number":875,"context_line":"        if ret and err:"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf659307_61ee2523","line":872,"range":{"start_line":872,"start_character":16,"end_line":872,"end_character":36},"updated":"2018-04-12 04:44:07.000000000","message":"From the man page:\n\n\u003e The FALLOC_FL_PUNCH_HOLE flag must be ORed with FALLOC_FL_KEEP_SIZE in mode; in other words, even when punching off the end of the file, the file size (as reported by stat(2)) does not change.","commit_id":"4e9792ac3f934cbdaa8f37ba4ef9e97d0983e993"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7cdfe63a601579f873d3be8f1b438e57cbfc009c","unresolved":false,"context_lines":[{"line_number":871,"context_line":"    if _sys_fallocate is None:"},{"line_number":872,"context_line":"        _sys_fallocate \u003d FallocateWrapper()"},{"line_number":873,"context_line":"    if size \u003c 0:"},{"line_number":874,"context_line":"        size \u003d 0"},{"line_number":875,"context_line":"    ret \u003d _sys_fallocate(fd, mode, ctypes.c_uint64(offset),"},{"line_number":876,"context_line":"                         ctypes.c_uint64(size))"},{"line_number":877,"context_line":"    err \u003d ctypes.get_errno()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_dc9bc570","side":"PARENT","line":874,"updated":"2018-09-12 18:25:40.000000000","message":"I think we maybe lost this guard... seems worth preserving. And probably also add a check on offset.","commit_id":"fd8988debdc85b53f3ac94fe9d412a6f215352c5"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"cc5f7241594a490217db6b6fef240a98b3c3b98c","unresolved":false,"context_lines":[{"line_number":871,"context_line":"    if _sys_fallocate is None:"},{"line_number":872,"context_line":"        _sys_fallocate \u003d FallocateWrapper()"},{"line_number":873,"context_line":"    if size \u003c 0:"},{"line_number":874,"context_line":"        size \u003d 0"},{"line_number":875,"context_line":"    ret \u003d _sys_fallocate(fd, mode, ctypes.c_uint64(offset),"},{"line_number":876,"context_line":"                         ctypes.c_uint64(size))"},{"line_number":877,"context_line":"    err \u003d ctypes.get_errno()"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_0597a047","side":"PARENT","line":874,"in_reply_to":"3f79a3b5_dc9bc570","updated":"2018-09-12 20:09:05.000000000","message":"Shouldn\u0027t we fail instead of setting the value to zero ?","commit_id":"fd8988debdc85b53f3ac94fe9d412a6f215352c5"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7cdfe63a601579f873d3be8f1b438e57cbfc009c","unresolved":false,"context_lines":[{"line_number":916,"context_line":"            _fallocate_warned_about_missing \u003d True"},{"line_number":917,"context_line":"        return"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"    if ret and err not in (0, errno.ENOSYS, errno.EOPNOTSUPP,"},{"line_number":920,"context_line":"                           errno.EINVAL):"},{"line_number":921,"context_line":"        raise OSError(err, \u0027Unable to fallocate(%s)\u0027 % size)"},{"line_number":922,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_9f81bf50","line":919,"range":{"start_line":919,"start_character":50,"end_line":919,"end_character":60},"updated":"2018-09-12 18:25:40.000000000","message":"http://man7.org/linux/man-pages/man3/errno.3.html makes me think that while this will probably work, we maybe ought to use ENOTSUP instead.\n\nBut that\u0027s right! http://man7.org/linux/man-pages/man2/fallocate.2.html goes and *explicitly says* EOPNOTSUPP... :-(\n\nThe main thing is, I found it weird that we look for EOPNOTSUPP here but then explicitly use ENOTSUP when we raise out own OSError down in hole_punch. Anybody got opinions?","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"cc5f7241594a490217db6b6fef240a98b3c3b98c","unresolved":false,"context_lines":[{"line_number":916,"context_line":"            _fallocate_warned_about_missing \u003d True"},{"line_number":917,"context_line":"        return"},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"    if ret and err not in (0, errno.ENOSYS, errno.EOPNOTSUPP,"},{"line_number":920,"context_line":"                           errno.EINVAL):"},{"line_number":921,"context_line":"        raise OSError(err, \u0027Unable to fallocate(%s)\u0027 % size)"},{"line_number":922,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_e56aa47f","line":919,"range":{"start_line":919,"start_character":50,"end_line":919,"end_character":60},"in_reply_to":"3f79a3b5_9f81bf50","updated":"2018-09-12 20:09:05.000000000","message":"Both manpages are correct, the linux code will return EOPNOTSUPP if unsupported, but anyway ENOTSUP \u003d\u003d EOPNOTSUPP (95)","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7cdfe63a601579f873d3be8f1b438e57cbfc009c","unresolved":false,"context_lines":[{"line_number":934,"context_line":"        ret \u003d _sys_fallocate("},{"line_number":935,"context_line":"            fd,"},{"line_number":936,"context_line":"            FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,"},{"line_number":937,"context_line":"            ctypes.c_uint64(offset),"},{"line_number":938,"context_line":"            ctypes.c_uint64(length))"},{"line_number":939,"context_line":"        err \u003d ctypes.get_errno()"},{"line_number":940,"context_line":"        if ret and err:"},{"line_number":941,"context_line":"            raise OSError(err, \"Unable to fallocate(%d, FALLOC_FL_PUNCH_HOLE,\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_1c537d6e","line":938,"range":{"start_line":937,"start_character":12,"end_line":938,"end_character":35},"updated":"2018-09-12 18:25:40.000000000","message":"Should we check that these aren\u0027t negative?","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"cc5f7241594a490217db6b6fef240a98b3c3b98c","unresolved":false,"context_lines":[{"line_number":934,"context_line":"        ret \u003d _sys_fallocate("},{"line_number":935,"context_line":"            fd,"},{"line_number":936,"context_line":"            FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE,"},{"line_number":937,"context_line":"            ctypes.c_uint64(offset),"},{"line_number":938,"context_line":"            ctypes.c_uint64(length))"},{"line_number":939,"context_line":"        err \u003d ctypes.get_errno()"},{"line_number":940,"context_line":"        if ret and err:"},{"line_number":941,"context_line":"            raise OSError(err, \"Unable to fallocate(%d, FALLOC_FL_PUNCH_HOLE,\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_85abb086","line":938,"range":{"start_line":937,"start_character":12,"end_line":938,"end_character":35},"in_reply_to":"3f79a3b5_1c537d6e","updated":"2018-09-12 20:09:05.000000000","message":"I think it\u0027s a good idea.\n\nThe offset should not be negative\nThe length should not be negative or \u003d\u003d 0\n\nIn either case, linux will return EINVAL","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"7cdfe63a601579f873d3be8f1b438e57cbfc009c","unresolved":false,"context_lines":[{"line_number":938,"context_line":"            ctypes.c_uint64(length))"},{"line_number":939,"context_line":"        err \u003d ctypes.get_errno()"},{"line_number":940,"context_line":"        if ret and err:"},{"line_number":941,"context_line":"            raise OSError(err, \"Unable to fallocate(%d, FALLOC_FL_PUNCH_HOLE,\""},{"line_number":942,"context_line":"                          \" %d, %d)\" % (fd, offset, length))"},{"line_number":943,"context_line":"    else:"},{"line_number":944,"context_line":"        raise OSError(errno.ENOTSUP,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_7f570303","line":941,"range":{"start_line":941,"start_character":56,"end_line":941,"end_character":76},"updated":"2018-09-12 18:25:40.000000000","message":"Should probably mention FALLOC_FL_KEEP_SIZE too","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"},{"author":{"_account_id":25251,"name":"Alexandre Lécuyer","email":"alexandre.lecuyer@corp.ovh.com","username":"alecuyer"},"change_message_id":"cc5f7241594a490217db6b6fef240a98b3c3b98c","unresolved":false,"context_lines":[{"line_number":938,"context_line":"            ctypes.c_uint64(length))"},{"line_number":939,"context_line":"        err \u003d ctypes.get_errno()"},{"line_number":940,"context_line":"        if ret and err:"},{"line_number":941,"context_line":"            raise OSError(err, \"Unable to fallocate(%d, FALLOC_FL_PUNCH_HOLE,\""},{"line_number":942,"context_line":"                          \" %d, %d)\" % (fd, offset, length))"},{"line_number":943,"context_line":"    else:"},{"line_number":944,"context_line":"        raise OSError(errno.ENOTSUP,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_65da144c","line":941,"range":{"start_line":941,"start_character":56,"end_line":941,"end_character":76},"in_reply_to":"3f79a3b5_7f570303","updated":"2018-09-12 20:09:05.000000000","message":"Good idea, it\u0027s not clear that fallocate() is being used for freeing space rather than allocating","commit_id":"de1f5c1805025892a42cf6fb1fab69f214787c6b"}]}
