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

Jens Axboe (axboe@suse.de)
Fri, 2 Mar 2001 16:28:24 +0100


--YiEDa0DAkWCtVeE4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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

--YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=loop-ac8-1

--- /opt/kernel/linux-2.4.2-ac8/drivers/block/loop.c Fri Mar 2 14:48:24 2001 +++ drivers/block/loop.c Fri 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);

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