)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Philippe SERAPHIN \u003cphilippe.seraphin@infomaniak.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-06-27 10:07:32 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adjust column width"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Idcc7cd7a41e225d1052c03ba846dff02851758f8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7fb9c778_3a502dbe","line":7,"updated":"2023-06-27 17:16:21.000000000","message":"Commit message could use updating -- maybe something like\n\n\u003e Check /dev/block symlinks when we can\u0027t stat mounted device\n\n?","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Philippe SERAPHIN \u003cphilippe.seraphin@infomaniak.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-06-27 10:07:32 +0200"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adjust column width"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Idcc7cd7a41e225d1052c03ba846dff02851758f8"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"c54fb011_51c95d03","line":7,"in_reply_to":"7fb9c778_3a502dbe","updated":"2023-06-28 07:38:40.000000000","message":"Done","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"244b1dac_cefbe4ec","updated":"2023-06-27 17:16:21.000000000","message":"At the very least, we\u0027ll want the commit message to better describe the change. I wonder a little if we might prefer to *just* scan `/dev/block` and skip the `stat`s -- WDYT?","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"904315ee_794986e6","in_reply_to":"244b1dac_cefbe4ec","updated":"2023-06-28 07:38:40.000000000","message":"Ok, sorry, this is my first time using git review and the original commit message has been replaced.\nI will put the scandir result in a dict and only perform a stat if the block device does not appear in /dev/block\nCheer","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"f20d9661d5b8eb6baae3ed4629662c604cb164c3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"1ead8ca7_ecceea98","updated":"2023-06-28 13:49:23.000000000","message":"recheck","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"094fcc6a064315bce8f5109aaf78ebaa74fb9511","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"37b99544_dd775bca","updated":"2023-06-28 09:50:05.000000000","message":"recheck","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ccc0940f04d41201425039db3932ab9c645af826","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"86bdb6f0_de7e76e9","updated":"2023-06-28 19:42:09.000000000","message":"recheck\n\nTest failures look suspicious -- I wonder if https://review.opendev.org/c/openstack/swift/+/885812 would help -- but definitely not related to this patch.","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"}],"bin/swift-drive-audit":[{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":true,"context_lines":[{"line_number":42,"context_line":"            device[\u0027mount_point\u0027] \u003d mount_point"},{"line_number":43,"context_line":"            device[\u0027block_device\u0027] \u003d block_device"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                device_num \u003d os.stat(block_device).st_rdev"},{"line_number":46,"context_line":"            except OSError:"},{"line_number":47,"context_line":"                # If we can\u0027t stat the device, then something weird is going on"},{"line_number":48,"context_line":"                # In this case, an error search in the Kernel logs must also"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"7ca2c174_1db064be","line":45,"updated":"2023-06-27 17:16:21.000000000","message":"OK, so the assertion is that this `stat` could fail, but we should (usually?) still be able to see the symlink in `/dev/block` -- do we know whether the converse would ever happen? That is, whether we could have a device that\n- shows up in `/proc/mounts`,\n- *doesn\u0027t* appear in `/dev/block`, and\n- *can* be `stat`ed?\n\nI wonder whether it might make more sense to just cross-reference `/proc/mounts` with `/dev/block` and skip the `stat`s entirely.","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[{"line_number":42,"context_line":"            device[\u0027mount_point\u0027] \u003d mount_point"},{"line_number":43,"context_line":"            device[\u0027block_device\u0027] \u003d block_device"},{"line_number":44,"context_line":"            try:"},{"line_number":45,"context_line":"                device_num \u003d os.stat(block_device).st_rdev"},{"line_number":46,"context_line":"            except OSError:"},{"line_number":47,"context_line":"                # If we can\u0027t stat the device, then something weird is going on"},{"line_number":48,"context_line":"                # In this case, an error search in the Kernel logs must also"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"20f05a22_37794a94","line":45,"in_reply_to":"7ca2c174_1db064be","updated":"2023-06-28 07:38:40.000000000","message":"Done","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":true,"context_lines":[{"line_number":48,"context_line":"                # In this case, an error search in the Kernel logs must also"},{"line_number":49,"context_line":"                # be carried out, and the device unmounted if necessary"},{"line_number":50,"context_line":"                with os.scandir(\"/dev/block\") as it:"},{"line_number":51,"context_line":"                    for ent in it:"},{"line_number":52,"context_line":"                        if ent.is_symlink():"},{"line_number":53,"context_line":"                            dev_name \u003d os.path.basename(os.readlink(ent.path))"},{"line_number":54,"context_line":"                            if dev_name \u003d\u003d os.path.basename(block_device):"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"45fc7a98_a0a1e61e","line":51,"updated":"2023-06-27 17:16:21.000000000","message":"I\u0027m a little worried about us doing this `scandir` multiple times for different mount points -- but this is just a rarely used fallback ATM \\*shrug\\*","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[{"line_number":48,"context_line":"                # In this case, an error search in the Kernel logs must also"},{"line_number":49,"context_line":"                # be carried out, and the device unmounted if necessary"},{"line_number":50,"context_line":"                with os.scandir(\"/dev/block\") as it:"},{"line_number":51,"context_line":"                    for ent in it:"},{"line_number":52,"context_line":"                        if ent.is_symlink():"},{"line_number":53,"context_line":"                            dev_name \u003d os.path.basename(os.readlink(ent.path))"},{"line_number":54,"context_line":"                            if dev_name \u003d\u003d os.path.basename(block_device):"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"a18c084f_af0ff094","line":51,"in_reply_to":"45fc7a98_a0a1e61e","updated":"2023-06-28 07:38:40.000000000","message":"Done","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":true,"context_lines":[{"line_number":55,"context_line":"                                majmin \u003d os.path.basename(ent.path).split(\u0027:\u0027)"},{"line_number":56,"context_line":"                                device[\u0027major\u0027] \u003d majmin[0]"},{"line_number":57,"context_line":"                                device[\u0027minor\u0027] \u003d majmin[1]"},{"line_number":58,"context_line":"                                devices.append(device)"},{"line_number":59,"context_line":"                logger.error(\"Error: Could not stat %s!\" %"},{"line_number":60,"context_line":"                             block_device)"},{"line_number":61,"context_line":"                continue"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"4a0136ee_2cf35b95","line":58,"updated":"2023-06-27 17:16:21.000000000","message":"nit: Could add a `break` here -- OTOH, we expect it to cap out around ~100, and it\u0027s for a background utility, so it probably doesn\u0027t matter _that_ much... but see suggestion below.","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                                majmin \u003d os.path.basename(ent.path).split(\u0027:\u0027)"},{"line_number":56,"context_line":"                                device[\u0027major\u0027] \u003d majmin[0]"},{"line_number":57,"context_line":"                                device[\u0027minor\u0027] \u003d majmin[1]"},{"line_number":58,"context_line":"                                devices.append(device)"},{"line_number":59,"context_line":"                logger.error(\"Error: Could not stat %s!\" %"},{"line_number":60,"context_line":"                             block_device)"},{"line_number":61,"context_line":"                continue"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"6924263c_bf2254e7","line":58,"in_reply_to":"4a0136ee_2cf35b95","updated":"2023-06-28 07:38:40.000000000","message":"Not needed any more","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"f0626ac5fd993acb821c88362c560c5666008a90","unresolved":true,"context_lines":[{"line_number":57,"context_line":"                                device[\u0027minor\u0027] \u003d majmin[1]"},{"line_number":58,"context_line":"                                devices.append(device)"},{"line_number":59,"context_line":"                logger.error(\"Error: Could not stat %s!\" %"},{"line_number":60,"context_line":"                             block_device)"},{"line_number":61,"context_line":"                continue"},{"line_number":62,"context_line":"            device[\u0027major\u0027] \u003d str(os.major(device_num))"},{"line_number":63,"context_line":"            device[\u0027minor\u0027] \u003d str(os.minor(device_num))"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"61d984da_3c20fae7","line":60,"updated":"2023-06-27 17:16:21.000000000","message":"This is still true -- we _couldn\u0027t_ stat the device directly -- but we\u0027ve lost some signal of whether we should expect an incomplete drive audit (i.e., whether we found a device to add to `devices` or not). I think I\u0027d prefer something like\n```\nwith os.scandir(\u0027/dev/block\u0027) as it:\n    for ent in it:\n        if ...:\n            ...\n            devices.append(device)\n            break\n    else:\n        logger.error(\u0027Could not determine major:minor numbers for %s \u0027\n                     \u0027(mounted at %s)! Skipping...\u0027,\n                     block_device, mount_point)\n```\nto keep _just_ the signal that something went wrong and we\u0027re **not** checking this device.","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":36116,"name":"Philippe SÉRAPHIN","email":"philippe.seraphin@infomaniak.com","username":"pseraf"},"change_message_id":"c880c0d4358e99080783043f3ab042a09110789f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                                device[\u0027minor\u0027] \u003d majmin[1]"},{"line_number":58,"context_line":"                                devices.append(device)"},{"line_number":59,"context_line":"                logger.error(\"Error: Could not stat %s!\" %"},{"line_number":60,"context_line":"                             block_device)"},{"line_number":61,"context_line":"                continue"},{"line_number":62,"context_line":"            device[\u0027major\u0027] \u003d str(os.major(device_num))"},{"line_number":63,"context_line":"            device[\u0027minor\u0027] \u003d str(os.minor(device_num))"}],"source_content_type":"application/octet-stream","patch_set":1,"id":"1ed8a3f0_48d7a85d","line":60,"in_reply_to":"61d984da_3c20fae7","updated":"2023-06-28 07:38:40.000000000","message":"Done","commit_id":"62482514656893f84d5d4ce0b944434bb3fe4e13"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ccc0940f04d41201425039db3932ab9c645af826","unresolved":true,"context_lines":[{"line_number":36,"context_line":"    majmin_devices \u003d {}"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    # List /dev/block"},{"line_number":39,"context_line":"    # Using os.scandir on recent versions of python, else os.listdir"},{"line_number":40,"context_line":"    if \u0027scandir\u0027 in dir(os):"},{"line_number":41,"context_line":"        with os.scandir(\"/dev/block\") as it:"},{"line_number":42,"context_line":"            for ent in it:"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"95cce1e4_b2651491","line":39,"updated":"2023-06-28 19:42:09.000000000","message":"Oh, thanks! I wasn\u0027t going to push back on supporting py2, since Yoga was the last release to officially support it -- but it\u0027s true that we still have some significant py2-isms and our packaging still indicates py2 support.","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ccc0940f04d41201425039db3932ab9c645af826","unresolved":true,"context_lines":[{"line_number":66,"context_line":"            if dev_name in majmin_devices:"},{"line_number":67,"context_line":"                # If symlink is in /dev/block"},{"line_number":68,"context_line":"                device[\u0027major\u0027] \u003d majmin_devices[dev_name][\u0027major\u0027]"},{"line_number":69,"context_line":"                device[\u0027minor\u0027] \u003d majmin_devices[dev_name][\u0027minor\u0027]"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                # Else we try to stat block_device"},{"line_number":72,"context_line":"                try:"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"a4444b8b_55223a04","line":69,"updated":"2023-06-28 19:42:09.000000000","message":"```\ndevice.update(majmin_devices[dev_name])\n```\n? Meh, w/e","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"ccc0940f04d41201425039db3932ab9c645af826","unresolved":true,"context_lines":[{"line_number":81,"context_line":"                    continue"},{"line_number":82,"context_line":"                device[\u0027major\u0027] \u003d str(os.major(device_num))"},{"line_number":83,"context_line":"                device[\u0027minor\u0027] \u003d str(os.minor(device_num))"},{"line_number":84,"context_line":"            devices.append(device)"},{"line_number":85,"context_line":"    for line in open(\u0027/proc/partitions\u0027).readlines()[2:]:"},{"line_number":86,"context_line":"        major, minor, blocks, kernel_device \u003d line.strip().split()"},{"line_number":87,"context_line":"        device \u003d [d for d in devices"}],"source_content_type":"application/octet-stream","patch_set":7,"id":"f912dbe4_a7ace06f","line":84,"updated":"2023-06-28 19:42:09.000000000","message":"I really like that we\u0027ve still got just the one `.append()`","commit_id":"1c210d2e49f3d3dd5a44cba8f240e3315d4aa3fa"}]}
