2013-08-12 14:27:59

by Jordi Pujol

[permalink] [raw]
Subject: ZRAM 3.10.6 Buffer I/O error

Hello,

zram shows an error when mounting a swap partition,
current version Linux kernel 3.10.6,
previous versions worked, I suppose that latest zram patches have some
problem,

machine is an AMD64 dual core, 4GB RAM

+ modprobe -qb zram num_devices=2
+ echo 104857600 > /sys/block/zram0/disksize

# mkswap /dev/zram0
Setting up swapspace version 1, size = 102396 KiB
no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d

# pager /var/log/dmesg
(no more errors shown)

# swapon /dev/zram0

# pager /var/log/dmesg
...
[ 309.300479] Buffer I/O error on device zram0, logical block 25599
[ 309.300491] Buffer I/O error on device zram0, logical block 25599
[ 309.300514] Buffer I/O error on device zram0, logical block 25599
[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
across:102396k SSFS

full log files and the kernel source are stored in the address:

http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/

Kind regards,

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com


2013-08-12 16:40:52

by Thomas Backlund

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

12.08.2013 17:27, Jordi Pujol skrev:
> Hello,
>
> zram shows an error when mounting a swap partition,
> current version Linux kernel 3.10.6,
> previous versions worked, I suppose that latest zram patches have some
> problem,
>
> machine is an AMD64 dual core, 4GB RAM
>
> + modprobe -qb zram num_devices=2
> + echo 104857600 > /sys/block/zram0/disksize
>
> # mkswap /dev/zram0
> Setting up swapspace version 1, size = 102396 KiB
> no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
>
> # pager /var/log/dmesg
> (no more errors shown)
>
> # swapon /dev/zram0
>
> # pager /var/log/dmesg
> ...
> [ 309.300479] Buffer I/O error on device zram0, logical block 25599
> [ 309.300491] Buffer I/O error on device zram0, logical block 25599
> [ 309.300514] Buffer I/O error on device zram0, logical block 25599
> [ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> across:102396k SSFS
>
> full log files and the kernel source are stored in the address:
>
> http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
>


I think this one should fix it and belongs in 3.10 stable too:

From 75c7caf5a052ffd8db3312fa7864ee2d142890c4 Mon Sep 17 00:00:00 2001
From: Sergey Senozhatsky <[email protected]>
Date: Sat, 22 Jun 2013 14:21:00 +0000
Subject: zram: allow request end to coincide with disksize

Pass valid_io_request() checks if request end coincides with disksize
(end equals bound), only fail if we attempt to read beyond the bound.

mkfs.ext2 produces numerous errors:
[ 2164.632747] quiet_error: 1 callbacks suppressed
[ 2164.633260] Buffer I/O error on device zram0, logical block 153599
[ 2164.633265] lost page write due to I/O error on zram0

Signed-off-by: Sergey Senozhatsky <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
diff --git a/drivers/staging/zram/zram_drv.c
b/drivers/staging/zram/zram_drv.c
index 7538774..82c7202 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -180,7 +180,7 @@ static inline int valid_io_request(struct zram
*zram, struct bio *bio)
end = start + (bio->bi_size >> SECTOR_SHIFT);
bound = zram->disksize >> SECTOR_SHIFT;
/* out of range range */
- if (unlikely(start >= bound || end >= bound || start > end))
+ if (unlikely(start >= bound || end > bound || start > end))
return 0;

/* I/O request is valid */
--
cgit v0.9.2

2013-08-13 01:39:03

by Minchan Kim

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

Hello,

On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> 12.08.2013 17:27, Jordi Pujol skrev:
> >Hello,
> >
> >zram shows an error when mounting a swap partition,
> >current version Linux kernel 3.10.6,
> >previous versions worked, I suppose that latest zram patches have some
> >problem,
> >
> >machine is an AMD64 dual core, 4GB RAM
> >
> >+ modprobe -qb zram num_devices=2
> >+ echo 104857600 > /sys/block/zram0/disksize
> >
> ># mkswap /dev/zram0
> >Setting up swapspace version 1, size = 102396 KiB
> >no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> >
> ># pager /var/log/dmesg
> >(no more errors shown)
> >
> ># swapon /dev/zram0
> >
> ># pager /var/log/dmesg
> >...
> >[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> >[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> >[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> >[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> >across:102396k SSFS
> >
> >full log files and the kernel source are stored in the address:
> >
> >http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> >
>
>
> I think this one should fix it and belongs in 3.10 stable too:

Very true. Let's Cc Greg, explicitely.

--
Kind regards,
Minchan Kim

2013-08-13 03:56:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
> Hello,
>
> On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> > 12.08.2013 17:27, Jordi Pujol skrev:
> > >Hello,
> > >
> > >zram shows an error when mounting a swap partition,
> > >current version Linux kernel 3.10.6,
> > >previous versions worked, I suppose that latest zram patches have some
> > >problem,
> > >
> > >machine is an AMD64 dual core, 4GB RAM
> > >
> > >+ modprobe -qb zram num_devices=2
> > >+ echo 104857600 > /sys/block/zram0/disksize
> > >
> > ># mkswap /dev/zram0
> > >Setting up swapspace version 1, size = 102396 KiB
> > >no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> > >
> > ># pager /var/log/dmesg
> > >(no more errors shown)
> > >
> > ># swapon /dev/zram0
> > >
> > ># pager /var/log/dmesg
> > >...
> > >[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> > >[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> > >[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> > >[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> > >across:102396k SSFS
> > >
> > >full log files and the kernel source are stored in the address:
> > >
> > >http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> > >
> >
> >
> > I think this one should fix it and belongs in 3.10 stable too:
>
> Very true. Let's Cc Greg, explicitely.

-ENOCONTEXT

2013-08-13 04:33:57

by Minchan Kim

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

Hello Greg,

On Mon, Aug 12, 2013 at 08:58:02PM -0700, Greg Kroah-Hartman wrote:
> On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
> > Hello,
> >
> > On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> > > 12.08.2013 17:27, Jordi Pujol skrev:
> > > >Hello,
> > > >
> > > >zram shows an error when mounting a swap partition,
> > > >current version Linux kernel 3.10.6,
> > > >previous versions worked, I suppose that latest zram patches have some
> > > >problem,
> > > >
> > > >machine is an AMD64 dual core, 4GB RAM
> > > >
> > > >+ modprobe -qb zram num_devices=2
> > > >+ echo 104857600 > /sys/block/zram0/disksize
> > > >
> > > ># mkswap /dev/zram0
> > > >Setting up swapspace version 1, size = 102396 KiB
> > > >no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> > > >
> > > ># pager /var/log/dmesg
> > > >(no more errors shown)
> > > >
> > > ># swapon /dev/zram0
> > > >
> > > ># pager /var/log/dmesg
> > > >...
> > > >[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> > > >[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> > > >[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> > > >[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> > > >across:102396k SSFS
> > > >
> > > >full log files and the kernel source are stored in the address:
> > > >
> > > >http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> > > >
> > >
> > >
> > > I think this one should fix it and belongs in 3.10 stable too:
> >
> > Very true. Let's Cc Greg, explicitely.
>
> -ENOCONTEXT

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/staging/zram?id=75c7caf5a052ffd8db3312fa7864ee2d142890c4

It seems you already merge "zram:allow request end to conincide with disksize" to stable.
So there is no concern any more.

Thanks.


--
Kind regards,
Minchan Kim

2013-08-13 05:06:45

by Thomas Backlund

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

Minchan Kim skrev 13.8.2013 07:33:
> Hello Greg,
>
> On Mon, Aug 12, 2013 at 08:58:02PM -0700, Greg Kroah-Hartman wrote:
>> On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
>>> Hello,
>>>
>>> On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
>>>> 12.08.2013 17:27, Jordi Pujol skrev:
>>>>> Hello,
>>>>>
>>>>> zram shows an error when mounting a swap partition,
>>>>> current version Linux kernel 3.10.6,
>>>>> previous versions worked, I suppose that latest zram patches have some
>>>>> problem,
>>>>>
>>>>> machine is an AMD64 dual core, 4GB RAM
>>>>>
>>>>> + modprobe -qb zram num_devices=2
>>>>> + echo 104857600 > /sys/block/zram0/disksize
>>>>>
>>>>> # mkswap /dev/zram0
>>>>> Setting up swapspace version 1, size = 102396 KiB
>>>>> no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
>>>>>
>>>>> # pager /var/log/dmesg
>>>>> (no more errors shown)
>>>>>
>>>>> # swapon /dev/zram0
>>>>>
>>>>> # pager /var/log/dmesg
>>>>> ...
>>>>> [ 309.300479] Buffer I/O error on device zram0, logical block 25599
>>>>> [ 309.300491] Buffer I/O error on device zram0, logical block 25599
>>>>> [ 309.300514] Buffer I/O error on device zram0, logical block 25599
>>>>> [ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
>>>>> across:102396k SSFS
>>>>>
>>>>> full log files and the kernel source are stored in the address:
>>>>>
>>>>> http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
>>>>>
>>>>
>>>>
>>>> I think this one should fix it and belongs in 3.10 stable too:
>>>
>>> Very true. Let's Cc Greg, explicitely.
>>
>> -ENOCONTEXT
>
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/staging/zram?id=75c7caf5a052ffd8db3312fa7864ee2d142890c4
>
> It seems you already merge "zram:allow request end to conincide with disksize" to stable.
> So there is no concern any more.

Nope...

thats master branch wich tracks upstream tree...

it's not in the 3.10 stable as of 3.10.6 (or current stable queue)

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/drivers/staging/zram?h=linux-3.10.y

--

Thomas

2013-08-13 05:13:55

by Jordi Pujol

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

El Dilluns, 12 d'agost de 2013, a les 19:39:46, Thomas Backlund va escriure:
> /* out of range range */
> - if (unlikely(start >= bound || end >= bound || start > end))
> + if (unlikely(start >= bound || end > bound || start > end))
> return 0;
>

OK, I confirm that this change solves the problem

Thanks,

Jordi Pujol

Live never ending Tale
GNU/Linux Live forever!
http://livenet.selfip.com

2013-08-13 05:18:29

by Minchan Kim

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

On Tue, Aug 13, 2013 at 08:01:11AM +0300, Thomas Backlund wrote:
> Minchan Kim skrev 13.8.2013 07:33:
> >Hello Greg,
> >
> >On Mon, Aug 12, 2013 at 08:58:02PM -0700, Greg Kroah-Hartman wrote:
> >>On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
> >>>Hello,
> >>>
> >>>On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> >>>>12.08.2013 17:27, Jordi Pujol skrev:
> >>>>>Hello,
> >>>>>
> >>>>>zram shows an error when mounting a swap partition,
> >>>>>current version Linux kernel 3.10.6,
> >>>>>previous versions worked, I suppose that latest zram patches have some
> >>>>>problem,
> >>>>>
> >>>>>machine is an AMD64 dual core, 4GB RAM
> >>>>>
> >>>>>+ modprobe -qb zram num_devices=2
> >>>>>+ echo 104857600 > /sys/block/zram0/disksize
> >>>>>
> >>>>># mkswap /dev/zram0
> >>>>>Setting up swapspace version 1, size = 102396 KiB
> >>>>>no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> >>>>>
> >>>>># pager /var/log/dmesg
> >>>>>(no more errors shown)
> >>>>>
> >>>>># swapon /dev/zram0
> >>>>>
> >>>>># pager /var/log/dmesg
> >>>>>...
> >>>>>[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> >>>>>[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> >>>>>[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> >>>>>[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> >>>>>across:102396k SSFS
> >>>>>
> >>>>>full log files and the kernel source are stored in the address:
> >>>>>
> >>>>>http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> >>>>>
> >>>>
> >>>>
> >>>>I think this one should fix it and belongs in 3.10 stable too:
> >>>
> >>>Very true. Let's Cc Greg, explicitely.
> >>
> >>-ENOCONTEXT
> >
> >https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/staging/zram?id=75c7caf5a052ffd8db3312fa7864ee2d142890c4
> >
> >It seems you already merge "zram:allow request end to conincide with disksize" to stable.
> >So there is no concern any more.
>
> Nope...
>
> thats master branch wich tracks upstream tree...
>
> it's not in the 3.10 stable as of 3.10.6 (or current stable queue)
>
> https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/drivers/staging/zram?h=linux-3.10.y

Okay, Then, we should explain it to Greg.

While Jiang was fixing a BUG A with [1], [1] made another BUG B.
So, Sergey fixed BUG B with [2]. But unfortunately, [1] was in stable
now but [2] wasn't so [2] should go to the stable to fix BUG B.

[1] 12a7ad3b8, zram: avoid access beyond the zram device
[2] 75c7caf5a, zram: allow request end to coincide with disksize

>
> --
>
> Thomas
>
> --
> 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/

--
Kind regards,
Minchan Kim

2013-08-13 05:45:54

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

On Tue, Aug 13, 2013 at 02:18:29PM +0900, Minchan Kim wrote:
> On Tue, Aug 13, 2013 at 08:01:11AM +0300, Thomas Backlund wrote:
> > Minchan Kim skrev 13.8.2013 07:33:
> > >Hello Greg,
> > >
> > >On Mon, Aug 12, 2013 at 08:58:02PM -0700, Greg Kroah-Hartman wrote:
> > >>On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
> > >>>Hello,
> > >>>
> > >>>On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> > >>>>12.08.2013 17:27, Jordi Pujol skrev:
> > >>>>>Hello,
> > >>>>>
> > >>>>>zram shows an error when mounting a swap partition,
> > >>>>>current version Linux kernel 3.10.6,
> > >>>>>previous versions worked, I suppose that latest zram patches have some
> > >>>>>problem,
> > >>>>>
> > >>>>>machine is an AMD64 dual core, 4GB RAM
> > >>>>>
> > >>>>>+ modprobe -qb zram num_devices=2
> > >>>>>+ echo 104857600 > /sys/block/zram0/disksize
> > >>>>>
> > >>>>># mkswap /dev/zram0
> > >>>>>Setting up swapspace version 1, size = 102396 KiB
> > >>>>>no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> > >>>>>
> > >>>>># pager /var/log/dmesg
> > >>>>>(no more errors shown)
> > >>>>>
> > >>>>># swapon /dev/zram0
> > >>>>>
> > >>>>># pager /var/log/dmesg
> > >>>>>...
> > >>>>>[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> > >>>>>[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> > >>>>>[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> > >>>>>[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> > >>>>>across:102396k SSFS
> > >>>>>
> > >>>>>full log files and the kernel source are stored in the address:
> > >>>>>
> > >>>>>http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> > >>>>>
> > >>>>
> > >>>>
> > >>>>I think this one should fix it and belongs in 3.10 stable too:
> > >>>
> > >>>Very true. Let's Cc Greg, explicitely.
> > >>
> > >>-ENOCONTEXT
> > >
> > >https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/staging/zram?id=75c7caf5a052ffd8db3312fa7864ee2d142890c4
> > >
> > >It seems you already merge "zram:allow request end to conincide with disksize" to stable.
> > >So there is no concern any more.
> >
> > Nope...
> >
> > thats master branch wich tracks upstream tree...
> >
> > it's not in the 3.10 stable as of 3.10.6 (or current stable queue)
> >
> > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/drivers/staging/zram?h=linux-3.10.y
>
> Okay, Then, we should explain it to Greg.
>
> While Jiang was fixing a BUG A with [1], [1] made another BUG B.
> So, Sergey fixed BUG B with [2]. But unfortunately, [1] was in stable
> now but [2] wasn't so [2] should go to the stable to fix BUG B.
>
> [1] 12a7ad3b8, zram: avoid access beyond the zram device
> [2] 75c7caf5a, zram: allow request end to coincide with disksize

Ok, but that's what Thomas's original email to [email protected]
asked for, to apply the 2nd patch above to the stable tree, which I've
already done...

Emailing me directly, with half-of-a-thread causes me nothing but
confusion, as I'm sure you can imagine.

thanks,

greg k-h

2013-08-13 05:46:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> 12.08.2013 17:27, Jordi Pujol skrev:
> > Hello,
> >
> > zram shows an error when mounting a swap partition,
> > current version Linux kernel 3.10.6,
> > previous versions worked, I suppose that latest zram patches have some
> > problem,
> >
> > machine is an AMD64 dual core, 4GB RAM
> >
> > + modprobe -qb zram num_devices=2
> > + echo 104857600 > /sys/block/zram0/disksize
> >
> > # mkswap /dev/zram0
> > Setting up swapspace version 1, size = 102396 KiB
> > no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> >
> > # pager /var/log/dmesg
> > (no more errors shown)
> >
> > # swapon /dev/zram0
> >
> > # pager /var/log/dmesg
> > ...
> > [ 309.300479] Buffer I/O error on device zram0, logical block 25599
> > [ 309.300491] Buffer I/O error on device zram0, logical block 25599
> > [ 309.300514] Buffer I/O error on device zram0, logical block 25599
> > [ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> > across:102396k SSFS
> >
> > full log files and the kernel source are stored in the address:
> >
> > http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> >
>
>
> I think this one should fix it and belongs in 3.10 stable too:
>
> From 75c7caf5a052ffd8db3312fa7864ee2d142890c4 Mon Sep 17 00:00:00 2001
> From: Sergey Senozhatsky <[email protected]>
> Date: Sat, 22 Jun 2013 14:21:00 +0000
> Subject: zram: allow request end to coincide with disksize

Now applied, thanks.

greg k-h

2013-08-13 06:03:53

by Minchan Kim

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

On Mon, Aug 12, 2013 at 10:47:12PM -0700, Greg Kroah-Hartman wrote:
> On Tue, Aug 13, 2013 at 02:18:29PM +0900, Minchan Kim wrote:
> > On Tue, Aug 13, 2013 at 08:01:11AM +0300, Thomas Backlund wrote:
> > > Minchan Kim skrev 13.8.2013 07:33:
> > > >Hello Greg,
> > > >
> > > >On Mon, Aug 12, 2013 at 08:58:02PM -0700, Greg Kroah-Hartman wrote:
> > > >>On Tue, Aug 13, 2013 at 10:39:00AM +0900, Minchan Kim wrote:
> > > >>>Hello,
> > > >>>
> > > >>>On Mon, Aug 12, 2013 at 07:39:46PM +0300, Thomas Backlund wrote:
> > > >>>>12.08.2013 17:27, Jordi Pujol skrev:
> > > >>>>>Hello,
> > > >>>>>
> > > >>>>>zram shows an error when mounting a swap partition,
> > > >>>>>current version Linux kernel 3.10.6,
> > > >>>>>previous versions worked, I suppose that latest zram patches have some
> > > >>>>>problem,
> > > >>>>>
> > > >>>>>machine is an AMD64 dual core, 4GB RAM
> > > >>>>>
> > > >>>>>+ modprobe -qb zram num_devices=2
> > > >>>>>+ echo 104857600 > /sys/block/zram0/disksize
> > > >>>>>
> > > >>>>># mkswap /dev/zram0
> > > >>>>>Setting up swapspace version 1, size = 102396 KiB
> > > >>>>>no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
> > > >>>>>
> > > >>>>># pager /var/log/dmesg
> > > >>>>>(no more errors shown)
> > > >>>>>
> > > >>>>># swapon /dev/zram0
> > > >>>>>
> > > >>>>># pager /var/log/dmesg
> > > >>>>>...
> > > >>>>>[ 309.300479] Buffer I/O error on device zram0, logical block 25599
> > > >>>>>[ 309.300491] Buffer I/O error on device zram0, logical block 25599
> > > >>>>>[ 309.300514] Buffer I/O error on device zram0, logical block 25599
> > > >>>>>[ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
> > > >>>>>across:102396k SSFS
> > > >>>>>
> > > >>>>>full log files and the kernel source are stored in the address:
> > > >>>>>
> > > >>>>>http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
> > > >>>>>
> > > >>>>
> > > >>>>
> > > >>>>I think this one should fix it and belongs in 3.10 stable too:
> > > >>>
> > > >>>Very true. Let's Cc Greg, explicitely.
> > > >>
> > > >>-ENOCONTEXT
> > > >
> > > >https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/drivers/staging/zram?id=75c7caf5a052ffd8db3312fa7864ee2d142890c4
> > > >
> > > >It seems you already merge "zram:allow request end to conincide with disksize" to stable.
> > > >So there is no concern any more.
> > >
> > > Nope...
> > >
> > > thats master branch wich tracks upstream tree...
> > >
> > > it's not in the 3.10 stable as of 3.10.6 (or current stable queue)
> > >
> > > https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/drivers/staging/zram?h=linux-3.10.y
> >
> > Okay, Then, we should explain it to Greg.
> >
> > While Jiang was fixing a BUG A with [1], [1] made another BUG B.
> > So, Sergey fixed BUG B with [2]. But unfortunately, [1] was in stable
> > now but [2] wasn't so [2] should go to the stable to fix BUG B.
> >
> > [1] 12a7ad3b8, zram: avoid access beyond the zram device
> > [2] 75c7caf5a, zram: allow request end to coincide with disksize
>
> Ok, but that's what Thomas's original email to [email protected]
> asked for, to apply the 2nd patch above to the stable tree, which I've
> already done...
>
> Emailing me directly, with half-of-a-thread causes me nothing but
> confusion, as I'm sure you can imagine.

Sorry for the noise and I will keep in mind.
Thanks!

--
Kind regards,
Minchan Kim

2013-08-13 11:07:34

by Luis Henriques

[permalink] [raw]
Subject: Re: ZRAM 3.10.6 Buffer I/O error

Thomas Backlund <[email protected]> writes:

> 12.08.2013 17:27, Jordi Pujol skrev:
>> Hello,
>>
>> zram shows an error when mounting a swap partition,
>> current version Linux kernel 3.10.6,
>> previous versions worked, I suppose that latest zram patches have some
>> problem,
>>
>> machine is an AMD64 dual core, 4GB RAM
>>
>> + modprobe -qb zram num_devices=2
>> + echo 104857600 > /sys/block/zram0/disksize
>>
>> # mkswap /dev/zram0
>> Setting up swapspace version 1, size = 102396 KiB
>> no label, UUID=6c249930-2ba0-46cf-a8c6-766481942b7d
>>
>> # pager /var/log/dmesg
>> (no more errors shown)
>>
>> # swapon /dev/zram0
>>
>> # pager /var/log/dmesg
>> ...
>> [ 309.300479] Buffer I/O error on device zram0, logical block 25599
>> [ 309.300491] Buffer I/O error on device zram0, logical block 25599
>> [ 309.300514] Buffer I/O error on device zram0, logical block 25599
>> [ 345.205887] Adding 102396k swap on /dev/zram0. Priority:-2 extents:1
>> across:102396k SSFS
>>
>> full log files and the kernel source are stored in the address:
>>
>> http://livenet.selfip.com/ftp/debian/zram_3.10.6_IO_error/
>>
>
>
> I think this one should fix it and belongs in 3.10 stable too:
>
> From 75c7caf5a052ffd8db3312fa7864ee2d142890c4 Mon Sep 17 00:00:00 2001
> From: Sergey Senozhatsky <[email protected]>
> Date: Sat, 22 Jun 2013 14:21:00 +0000
> Subject: zram: allow request end to coincide with disksize
>
> Pass valid_io_request() checks if request end coincides with disksize
> (end equals bound), only fail if we attempt to read beyond the bound.
>
> mkfs.ext2 produces numerous errors:
> [ 2164.632747] quiet_error: 1 callbacks suppressed
> [ 2164.633260] Buffer I/O error on device zram0, logical block 153599
> [ 2164.633265] lost page write due to I/O error on zram0
>
> Signed-off-by: Sergey Senozhatsky <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> ---
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index 7538774..82c7202 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -180,7 +180,7 @@ static inline int valid_io_request(struct zram *zram, struct
> bio *bio)
> end = start + (bio->bi_size >> SECTOR_SHIFT);
> bound = zram->disksize >> SECTOR_SHIFT;
> /* out of range range */
> - if (unlikely(start >= bound || end >= bound || start > end))
> + if (unlikely(start >= bound || end > bound || start > end))
> return 0;
>
> /* I/O request is valid */
> --
> cgit v0.9.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

I believe this patch should be applied to other stable trees that also
contain commit 12a7ad3b810e77137d0caf97a6dd97591e075b30 ("zram: avoid
access beyond the zram device"). I'm queuing it for the 3.5 kernel.

Cheers,
--
Luis