projects
/
platform
/
upstream
/
cryptsetup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
13f4fea
)
Require loop autoclear support.
author
Milan Broz
<gmazyland@gmail.com>
Sat, 12 Mar 2011 21:05:47 +0000
(21:05 +0000)
committer
Milan Broz
<gmazyland@gmail.com>
Sat, 12 Mar 2011 21:05:47 +0000
(21:05 +0000)
git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@446
36d66b0a
-2a48-0410-832c-
cd162a569da5
lib/utils_loop.c
patch
|
blob
|
history
diff --git
a/lib/utils_loop.c
b/lib/utils_loop.c
index
3a8df47
..
cbaef4b
100644
(file)
--- a/
lib/utils_loop.c
+++ b/
lib/utils_loop.c
@@
-83,6
+83,15
@@
int crypt_loop_attach(const char *loop, const char *file,
(void)ioctl(loop_fd, LOOP_CLR_FD, 0);
goto out;
}
+
+ /* Verify that autoclear is really set */
+ memset(&lo64, 0, sizeof(lo64));
+ if (ioctl(loop_fd, LOOP_GET_STATUS64, &lo64) < 0 ||
+ !(lo64.lo_flags & LO_FLAGS_AUTOCLEAR)) {
+ (void)ioctl(loop_fd, LOOP_CLR_FD, 0);
+ goto out;
+ }
+
r = 0;
out:
if (r && loop_fd >= 0)