Pls Help: How to write immediately to crypted fs? (cryptoloop)

This is a discussion on Pls Help: How to write immediately to crypted fs? (cryptoloop) within the Linux Security forums, part of the System Security and Security Related category; Hi, I use the cryptoloop via the losetup (with twofish) to encrypt a partition. Within the encrypted partition I use ...


Go Back   Usenet Forums > System Security and Security Related > Linux Security

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-07-2004
Thorben Suhr
 
Posts: n/a
Default Pls Help: How to write immediately to crypted fs? (cryptoloop)

Hi,

I use the cryptoloop via the losetup (with twofish) to encrypt a
partition. Within the encrypted partition I use the ext3 fs, which
I've "tuned" with commit=<x>, data=journal, mounted with -o sync etc.

But nevertheless the time until a write() from my application is on
the disk can be up to 30 seconds?!?! Even a subsequent fsync() from
the app doesn't has any effect.

So, what happens is like this:

1. losetup /dev/hdaX /dev/loop1 (w/ twofish)
2. mke2fs -t ext3 /dev/loop1
3. mount /dev/loop1 /home
4. Start App
5. fd = open(/home/file.dat)
6. write(fd, data)
[6a. fsync(fd)]
7. close(fd)
8. Leave App
...
9. Wait up to X seconds
10. de-energize the system
11. Power-on, boot again
12. /home/file.dat is like before 4.

Is this normal??? How can I reduce the time to near null?

I think, the lap must be in (?) the loopdevice, because on a plain
ext3 partition it seems to work (write immediately).

Thanks in advance,
Thorben
Reply With Quote
  #2 (permalink)  
Old 12-08-2004
Ari Rankum
 
Posts: n/a
Default Re: Pls Help: How to write immediately to crypted fs? (cryptoloop)

Thorben Suhr wrote:
> Hi,
>
> I use the cryptoloop via the losetup (with twofish) to encrypt a
> partition. Within the encrypted partition I use the ext3 fs, which
> I've "tuned" with commit=<x>, data=journal, mounted with -o sync etc.
>
> But nevertheless the time until a write() from my application is on
> the disk can be up to 30 seconds?!?! Even a subsequent fsync() from
> the app doesn't has any effect.
>
> So, what happens is like this:
>
> 1. losetup /dev/hdaX /dev/loop1 (w/ twofish)
> 2. mke2fs -t ext3 /dev/loop1
> 3. mount /dev/loop1 /home
> 4. Start App
> 5. fd = open(/home/file.dat)
> 6. write(fd, data)
> [6a. fsync(fd)]
> 7. close(fd)
> 8. Leave App
> ...
> 9. Wait up to X seconds
> 10. de-energize the system
> 11. Power-on, boot again
> 12. /home/file.dat is like before 4.
>
> Is this normal??? How can I reduce the time to near null?


Go back and re-read the man page for the open system call (man 2 read).
Pay special attention to the comments about the flags O_SYNC,
O_DIRECT, and the restrictions on their use.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:25 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0