cmd_show_super: Print backing file as the loop device "model"

Signed-off-by: Nikita Ofitserov <himikof@gmail.com>
This commit is contained in:
Nikita Ofitserov 2025-09-28 03:18:34 +03:00
parent a4f2c56ed4
commit 0a1ad84c02

View File

@ -637,6 +637,13 @@ char *fd_to_dev_model(int fd)
goto got_model;
free(model_path);
/* loop device? try loop/backing_file */
model_path = mprintf("%s/loop/backing_file", sysfs_path);
if (!access(model_path, R_OK))
goto got_model;
free(model_path);
free(sysfs_path);
return strdup("(unknown model)");
got_model: