Fix deferred remove test failure on non-udev systems.

Deferred remove non-udev enabled libdevmapper removes
device mapper symlinks immediately. We have to check
device size from sysfs attributes.
This commit is contained in:
Ondrej Kozina
2021-08-22 10:56:26 +02:00
committed by Milan Broz
parent 26679e223c
commit 53b22cc32e
4 changed files with 66 additions and 5 deletions

View File

@@ -96,6 +96,8 @@ void xlog(const char *msg, const char *tst, const char *func, int line, const ch
#define CRYPT_FREE(x) do { crypt_free(x); x = NULL; } while (0)
#define DMDIR "/dev/mapper/"
#define TST_SECTOR_SHIFT 9L
#define TST_SECTOR_SIZE 512
#define TST_LOOP_FILE_SIZE (((1 << 20) * 100) >> TST_SECTOR_SHIFT)
@@ -124,4 +126,7 @@ int loop_attach(char **loop, const char *file, int offset,
int autoclear, int *readonly);
int loop_detach(const char *loop);
int t_device_size_by_devno(dev_t devno, uint64_t *retval);
int t_get_devno(const char *dev, dev_t *devno);
#endif