diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index 6f4eab2bc..d9420d236 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -147,20 +147,23 @@ static void detectType(FF_MAYBE_UNUSED const FFlist* devices, FFDisk* currentDis static bool isSubvolume(const FFlist* devices) { - const FFstrbuf* currentDevie = ffListGet(devices, devices->length - 1); + const FFstrbuf* current = ffListGet(devices, devices->length - 1); + + if(ffStrbufEqualS(current, "drvfs")) // WSL Windows drives + return false; //Filter all disks which device was already found. This catches BTRFS subvolumes. for(uint32_t i = 0; i < devices->length - 1; i++) { const FFstrbuf* otherDevice = ffListGet(devices, i); - if(ffStrbufEqual(currentDevie, otherDevice)) + if(ffStrbufEqual(current, otherDevice)) return true; } //ZFS subvolumes: rpool///. //Test if the third slash is present. - if(strncmp(currentDevie->chars, "rpool/", 6) == 0 && ffStrHasNChars(currentDevie->chars, '/', 3)) + if(ffStrbufStartsWithS(current, "rpool/") && ffStrHasNChars(current->chars, '/', 3)) return true; return false;