Do not scan rotational flag for non-block devices / file images.
authorMilan Broz <gmazyland@gmail.com>
Mon, 27 Aug 2012 10:42:15 +0000 (12:42 +0200)
committerMilan Broz <gmazyland@gmail.com>
Mon, 27 Aug 2012 10:42:15 +0000 (12:42 +0200)
lib/utils_wipe.c

index e6190e40f913277c2c743036d9532e2e4b20d7dd..96a183aa1b54f00f17199e031cb483256c32b7d9 100644 (file)
@@ -136,7 +136,8 @@ int crypt_wipe(struct device *device,
                return -EINVAL;
        }
 
-       if (type == CRYPT_WIPE_DISK) {
+       if (type == CRYPT_WIPE_DISK && S_ISBLK(st.st_mode)) {
+               rotational = 0;
                if (!crypt_sysfs_get_rotational(major(st.st_rdev),
                                                minor(st.st_rdev),
                                                &rotational))