Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
> But with old 2.2 - Material stored on DVD-RAM. 
> 
>   losetup -e blowfish /dev/loop0 /dev/sr3
>   lsoetup -e serpent /dev/loop1 /dev/loop0
> 
> it doesn't work.

(replied to Mario earlier, for reference here's the patch).

Yet another miscount and IV off, I apparently missed the latter
when the other IV calculations were fixed. I've verified block
crypto here now.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac10/drivers/block/loop.c   Sat Mar  3 04:16:23 2001
+++ drivers/block/loop.cSat Mar  3 04:18:54 2001
@@ -345,8 +345,6 @@
struct buffer_head *rbh = bh->b_private;
 
rbh->b_end_io(rbh, uptodate);
-   if (atomic_dec_and_test(>lo_pending))
-   up(>lo_bh_mutex);
loop_put_buffer(bh);
} else
loop_add_bh(lo, bh);
@@ -479,6 +477,7 @@
 
IV = (bh->b_rsector / (bh->b_size >> 9));
IV += lo->lo_offset / bh->b_size;
+   IV >>= 2;
 
ret = lo_do_transfer(lo, READ, bh->b_data, rbh->b_data,
 bh->b_size, IV);



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello!

Jens Axboe wrote:
> 
> On Fri, Mar 02 2001, Mario Hermann wrote:
> > There is another small bug with the loop over loop problem. Now it works
> > fine for
> > files but not for Devices:
> >
> > losetup /dev/loop0 /dev/sr1
> > losetup /dev/loop1 /dev/loop0
> > dd if=/dev/loop1 of=test.dat bs=2048 count=1024
> 
> Pending miscount, this should fix it.


Ok, I did some testing again. What I found:

Without crypto: Everything works good!

With crypto:

I used the ciphers: idea,serbent, aes, blowfish(with small patch in
cipher-blowfish send somewhere in the past)

Only 2.4.2-ac8 Material: Everything is ok. 

With  old 2.2-Material:

Encrypted in the way: 

 losetup -e blowfish /dev/loop0 ./test.file
 losetup -e serpent /dev/loop1 /dev/loop0

It works perfect too! :-)

But with old 2.2 - Material stored on DVD-RAM. 

  losetup -e blowfish /dev/loop0 /dev/sr3
  lsoetup -e serpent /dev/loop1 /dev/loop0

it doesn't work.

Just garbage comes out of the loop-device.
Both, the file on the harddisk and the DVD-RAM are made with 2.2.16 an
patch-int-2.2.16.9 and are working
there perfectly. 

I guess that the problem has maybe something to do with the logical
block number.

Well, for me was the HD-File important to work under 2.4 (DB-on it...)

So great thx from me!

Hope my testing will help in some way. (will do some more monday
afternoon)


---
Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
> There is another small bug with the loop over loop problem. Now it works
> fine for
> files but not for Devices:
> 
> losetup /dev/loop0 /dev/sr1
> losetup /dev/loop1 /dev/loop0
> dd if=/dev/loop1 of=test.dat bs=2048 count=1024

Pending miscount, this should fix it.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac8/drivers/block/loop.cFri Mar  2 14:48:24 2001
+++ drivers/block/loop.cFri Mar  2 16:27:31 2001
@@ -307,6 +307,7 @@
lo->lo_bh = lo->lo_bhtail = bh;
spin_unlock_irqrestore(>lo_lock, flags);
 
+   atomic_inc(>lo_pending);
up(>lo_bh_mutex);
 }
 
@@ -404,7 +405,6 @@
spin_lock_irq(>lo_lock);
if (lo->lo_state != Lo_bound)
goto inactive;
-   atomic_inc(>lo_pending);
spin_unlock_irq(>lo_lock);
 
if (rw == WRITE) {
@@ -452,8 +452,6 @@
return 0;
 
 err:
-   if (atomic_dec_and_test(>lo_pending))
-   up(>lo_bh_mutex);
loop_put_buffer(bh);
 out:
buffer_IO_error(rbh);



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
> > > I tried the following commands with 2.4.2-ac7:
> > >
> > > losetup /dev/loop0 test.dat
> > > losetup /dev/loop1 /dev/loop0
> > > mke2fs /dev/loop1
> > >
> > > My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too -> same
> > > effect.
> > >
> > > With 2.4.2 it hangs immediatly.
> > 
> > This should make it work again.
> 
> There is another small bug with the loop over loop problem. Now it works
> fine for
> files but not for Devices:
> 
> losetup /dev/loop0 /dev/sr1
> losetup /dev/loop1 /dev/loop0
> dd if=/dev/loop1 of=test.dat bs=2048 count=1024
> 
> Makes dd hang. (BTW: /dev/sr1 is a CD-ROM)
> 
> Tried the same on /dev/hda1, /dev/sda1 with 2.4.2-ac7-your_patch and
> with 2.4.2-ac8.

I must admit that I haven't tried loop-over-loop at all really,
I'll make a note to look at this tonight.

> BTW: Did extensiv testing with and without the crypto patches. And all
> other tests worked fine! :-)

Great.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello!

Jens Axboe wrote:
> 
> On Thu, Mar 01 2001, Mario Hermann wrote:
> > I tried the following commands with 2.4.2-ac7:
> >
> > losetup /dev/loop0 test.dat
> > losetup /dev/loop1 /dev/loop0
> > mke2fs /dev/loop1
> >
> > My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too -> same
> > effect.
> >
> > With 2.4.2 it hangs immediatly.
> 
> This should make it work again.

There is another small bug with the loop over loop problem. Now it works
fine for
files but not for Devices:

losetup /dev/loop0 /dev/sr1
losetup /dev/loop1 /dev/loop0
dd if=/dev/loop1 of=test.dat bs=2048 count=1024

Makes dd hang. (BTW: /dev/sr1 is a CD-ROM)

Tried the same on /dev/hda1, /dev/sda1 with 2.4.2-ac7-your_patch and
with 2.4.2-ac8.

BTW: Did extensiv testing with and without the crypto patches. And all
other tests worked fine! :-)

--
Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello,

Jens Axboe wrote:

> 
> This should make it work again.

Yeah! Works fine.


> 
> --
> Jens Axboe
> 

Thx


Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello,

Jens Axboe wrote:

 
 This should make it work again.

Yeah! Works fine.


 
 --
 Jens Axboe
 

Thx


Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello!

Jens Axboe wrote:
 
 On Thu, Mar 01 2001, Mario Hermann wrote:
  I tried the following commands with 2.4.2-ac7:
 
  losetup /dev/loop0 test.dat
  losetup /dev/loop1 /dev/loop0
  mke2fs /dev/loop1
 
  My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too - same
  effect.
 
  With 2.4.2 it hangs immediatly.
 
 This should make it work again.

There is another small bug with the loop over loop problem. Now it works
fine for
files but not for Devices:

losetup /dev/loop0 /dev/sr1
losetup /dev/loop1 /dev/loop0
dd if=/dev/loop1 of=test.dat bs=2048 count=1024

Makes dd hang. (BTW: /dev/sr1 is a CD-ROM)

Tried the same on /dev/hda1, /dev/sda1 with 2.4.2-ac7-your_patch and
with 2.4.2-ac8.

BTW: Did extensiv testing with and without the crypto patches. And all
other tests worked fine! :-)

--
Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
   I tried the following commands with 2.4.2-ac7:
  
   losetup /dev/loop0 test.dat
   losetup /dev/loop1 /dev/loop0
   mke2fs /dev/loop1
  
   My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too - same
   effect.
  
   With 2.4.2 it hangs immediatly.
  
  This should make it work again.
 
 There is another small bug with the loop over loop problem. Now it works
 fine for
 files but not for Devices:
 
 losetup /dev/loop0 /dev/sr1
 losetup /dev/loop1 /dev/loop0
 dd if=/dev/loop1 of=test.dat bs=2048 count=1024
 
 Makes dd hang. (BTW: /dev/sr1 is a CD-ROM)
 
 Tried the same on /dev/hda1, /dev/sda1 with 2.4.2-ac7-your_patch and
 with 2.4.2-ac8.

I must admit that I haven't tried loop-over-loop at all really,
I'll make a note to look at this tonight.

 BTW: Did extensiv testing with and without the crypto patches. And all
 other tests worked fine! :-)

Great.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
 There is another small bug with the loop over loop problem. Now it works
 fine for
 files but not for Devices:
 
 losetup /dev/loop0 /dev/sr1
 losetup /dev/loop1 /dev/loop0
 dd if=/dev/loop1 of=test.dat bs=2048 count=1024

Pending miscount, this should fix it.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac8/drivers/block/loop.cFri Mar  2 14:48:24 2001
+++ drivers/block/loop.cFri Mar  2 16:27:31 2001
@@ -307,6 +307,7 @@
lo-lo_bh = lo-lo_bhtail = bh;
spin_unlock_irqrestore(lo-lo_lock, flags);
 
+   atomic_inc(lo-lo_pending);
up(lo-lo_bh_mutex);
 }
 
@@ -404,7 +405,6 @@
spin_lock_irq(lo-lo_lock);
if (lo-lo_state != Lo_bound)
goto inactive;
-   atomic_inc(lo-lo_pending);
spin_unlock_irq(lo-lo_lock);
 
if (rw == WRITE) {
@@ -452,8 +452,6 @@
return 0;
 
 err:
-   if (atomic_dec_and_test(lo-lo_pending))
-   up(lo-lo_bh_mutex);
loop_put_buffer(bh);
 out:
buffer_IO_error(rbh);



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Mario Hermann

Hello!

Jens Axboe wrote:
 
 On Fri, Mar 02 2001, Mario Hermann wrote:
  There is another small bug with the loop over loop problem. Now it works
  fine for
  files but not for Devices:
 
  losetup /dev/loop0 /dev/sr1
  losetup /dev/loop1 /dev/loop0
  dd if=/dev/loop1 of=test.dat bs=2048 count=1024
 
 Pending miscount, this should fix it.


Ok, I did some testing again. What I found:

Without crypto: Everything works good!

With crypto:

I used the ciphers: idea,serbent, aes, blowfish(with small patch in
cipher-blowfish send somewhere in the past)

Only 2.4.2-ac8 Material: Everything is ok. 

With  old 2.2-Material:

Encrypted in the way: 

 losetup -e blowfish /dev/loop0 ./test.file
 losetup -e serpent /dev/loop1 /dev/loop0

It works perfect too! :-)

But with old 2.2 - Material stored on DVD-RAM. 

  losetup -e blowfish /dev/loop0 /dev/sr3
  lsoetup -e serpent /dev/loop1 /dev/loop0

it doesn't work.

Just garbage comes out of the loop-device.
Both, the file on the harddisk and the DVD-RAM are made with 2.2.16 an
patch-int-2.2.16.9 and are working
there perfectly. 

I guess that the problem has maybe something to do with the logical
block number.

Well, for me was the HD-File important to work under 2.4 (DB-on it...)

So great thx from me!

Hope my testing will help in some way. (will do some more monday
afternoon)


---
Mario Hermann
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-02 Thread Jens Axboe

On Fri, Mar 02 2001, Mario Hermann wrote:
 But with old 2.2 - Material stored on DVD-RAM. 
 
   losetup -e blowfish /dev/loop0 /dev/sr3
   lsoetup -e serpent /dev/loop1 /dev/loop0
 
 it doesn't work.

(replied to Mario earlier, for reference here's the patch).

Yet another miscount and IV off, I apparently missed the latter
when the other IV calculations were fixed. I've verified block
crypto here now.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac10/drivers/block/loop.c   Sat Mar  3 04:16:23 2001
+++ drivers/block/loop.cSat Mar  3 04:18:54 2001
@@ -345,8 +345,6 @@
struct buffer_head *rbh = bh-b_private;
 
rbh-b_end_io(rbh, uptodate);
-   if (atomic_dec_and_test(lo-lo_pending))
-   up(lo-lo_bh_mutex);
loop_put_buffer(bh);
} else
loop_add_bh(lo, bh);
@@ -479,6 +477,7 @@
 
IV = (bh-b_rsector / (bh-b_size  9));
IV += lo-lo_offset / bh-b_size;
+   IV = 2;
 
ret = lo_do_transfer(lo, READ, bh-b_data, rbh-b_data,
 bh-b_size, IV);



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-01 Thread Jens Axboe

On Thu, Mar 01 2001, Mario Hermann wrote:
> I tried the following commands with 2.4.2-ac7:
> 
> losetup /dev/loop0 test.dat
> losetup /dev/loop1 /dev/loop0
> mke2fs /dev/loop1
> 
> My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too -> same
> effect.
> 
> With 2.4.2 it hangs immediatly.

This should make it work again.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac7/drivers/block/loop.cThu Mar  1 15:46:14 2001
+++ drivers/block/loop.cThu Mar  1 17:17:13 2001
@@ -397,10 +397,10 @@
if (!buffer_locked(rbh))
BUG();
 
-   if (MINOR(rbh->b_dev) >= max_loop)
+   if (MINOR(rbh->b_rdev) >= max_loop)
goto out;
 
-   lo = _dev[MINOR(rbh->b_dev)];
+   lo = _dev[MINOR(rbh->b_rdev)];
spin_lock_irq(>lo_lock);
if (lo->lo_state != Lo_bound)
goto inactive;



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-01 Thread Jens Axboe

On Thu, Mar 01 2001, Mario Hermann wrote:
> Hello!
> 
> I tried the following commands with 2.4.2-ac7:
> 
> losetup /dev/loop0 test.dat
> losetup /dev/loop1 /dev/loop0
> mke2fs /dev/loop1
> 
> My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too -> same
> effect.

Oops, will take a look.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-01 Thread Jens Axboe

On Thu, Mar 01 2001, Mario Hermann wrote:
 Hello!
 
 I tried the following commands with 2.4.2-ac7:
 
 losetup /dev/loop0 test.dat
 losetup /dev/loop1 /dev/loop0
 mke2fs /dev/loop1
 
 My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too - same
 effect.

Oops, will take a look.

-- 
Jens Axboe

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: report bug: System reboots when accessing a loop-device over a second loop-device with 2.4.2-ac7

2001-03-01 Thread Jens Axboe

On Thu, Mar 01 2001, Mario Hermann wrote:
 I tried the following commands with 2.4.2-ac7:
 
 losetup /dev/loop0 test.dat
 losetup /dev/loop1 /dev/loop0
 mke2fs /dev/loop1
 
 My System reboots immediatly. I tried it with 2.4.2-ac4,ac5 too - same
 effect.
 
 With 2.4.2 it hangs immediatly.

This should make it work again.

-- 
Jens Axboe



--- /opt/kernel/linux-2.4.2-ac7/drivers/block/loop.cThu Mar  1 15:46:14 2001
+++ drivers/block/loop.cThu Mar  1 17:17:13 2001
@@ -397,10 +397,10 @@
if (!buffer_locked(rbh))
BUG();
 
-   if (MINOR(rbh-b_dev) = max_loop)
+   if (MINOR(rbh-b_rdev) = max_loop)
goto out;
 
-   lo = loop_dev[MINOR(rbh-b_dev)];
+   lo = loop_dev[MINOR(rbh-b_rdev)];
spin_lock_irq(lo-lo_lock);
if (lo-lo_state != Lo_bound)
goto inactive;