<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/staging/zram, branch v3.0</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>staging: Allow sharing xvmalloc for zram and zcache</title>
<updated>2011-02-23T22:02:56+00:00</updated>
<author>
<name>Nitin Gupta</name>
<email>ngupta@vflare.org</email>
</author>
<published>2011-02-18T22:33:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=3c8bb7aab9ad84bce7d81878fda64d631089a88d'/>
<id>3c8bb7aab9ad84bce7d81878fda64d631089a88d</id>
<content type='text'>
Both zram and zcache use xvmalloc allocator. If xvmalloc
is compiled separately for both of them, we will get linker
error if they are both selected as "built-in". We can also
get linker error regarding missing xvmalloc symbols if zram
is not built.

So, we now compile xvmalloc separately and export its symbols
which are then used by both of zram and zcache.

Signed-off-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Acked-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Both zram and zcache use xvmalloc allocator. If xvmalloc
is compiled separately for both of them, we will get linker
error if they are both selected as "built-in". We can also
get linker error regarding missing xvmalloc symbols if zram
is not built.

So, we now compile xvmalloc separately and export its symbols
which are then used by both of zram and zcache.

Signed-off-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Acked-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Staging: zram: initialize device on first read</title>
<updated>2011-02-18T21:26:12+00:00</updated>
<author>
<name>Jerome Marchand</name>
<email>jmarchan@redhat.com</email>
</author>
<published>2011-02-17T16:11:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=6642a67c552e6d525913bb5fb4a00b2008213451'/>
<id>6642a67c552e6d525913bb5fb4a00b2008213451</id>
<content type='text'>
Currently the device is initialized when first write is done to the
device. Any read attempt before the first write would fail, including
"hidden" read the user may not know about (as for example if he tries
to write a partial block).

This patch initializes the device on first request, whether read or
write.

Signed-off-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the device is initialized when first write is done to the
device. Any read attempt before the first write would fail, including
"hidden" read the user may not know about (as for example if he tries
to write a partial block).

This patch initializes the device on first request, whether read or
write.

Signed-off-by: Jerome Marchand &lt;jmarchan@redhat.com&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 2.6.38-rc5 into staging-next</title>
<updated>2011-02-18T20:11:27+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@suse.de</email>
</author>
<published>2011-02-18T20:11:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=80ae3fa5d6712ef3625eff617f72e190645d6361'/>
<id>80ae3fa5d6712ef3625eff617f72e190645d6361</id>
<content type='text'>
This is to resolve a merge conflict with:
	drivers/staging/zram/zram_drv.c
as pointed out by Stephen Rothwell

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is to resolve a merge conflict with:
	drivers/staging/zram/zram_drv.c
as pointed out by Stephen Rothwell

Cc: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Cc: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>staging: zram: fix data corruption issue</title>
<updated>2011-02-09T19:39:51+00:00</updated>
<author>
<name>Nitin Gupta</name>
<email>ngupta@vflare.org</email>
</author>
<published>2011-02-06T01:34:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5414e557fca545614ceedc3d3496f747457e2e3b'/>
<id>5414e557fca545614ceedc3d3496f747457e2e3b</id>
<content type='text'>
In zram_read() and zram_write() we were not incrementing the
index number and thus were reading/writing values from/to
incorrect sectors on zram disk, resulting in data corruption.

Signed-off-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In zram_read() and zram_write() we were not incrementing the
index number and thus were reading/writing values from/to
incorrect sectors on zram disk, resulting in data corruption.

Signed-off-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram/xvmalloc: combine duplicate block delete code</title>
<updated>2011-02-04T21:29:12+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T15:01:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=939b3f0b1415755d534a20f4067e6b367e1e4021'/>
<id>939b3f0b1415755d534a20f4067e6b367e1e4021</id>
<content type='text'>
This patch eliminates duplicate code.  The remove_block_head function
is a special case of remove_block which can be contained in remove_block
without confusion.

The portion of code in remove_block_head which was noted as "DEBUG ONLY"
is now mandatory.  Doing this provides consistent management of the double
linked list of blocks under a freelist and makes this consolidation
of delete block code safe.  The first and last blocks will have NULL
pointers in their previous and next page pointers respectively.

Additionally, any time a block is removed from a free list the next and
previous pointers will be set to NULL to avoid misuse outside xvmalloc.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Acked-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch eliminates duplicate code.  The remove_block_head function
is a special case of remove_block which can be contained in remove_block
without confusion.

The portion of code in remove_block_head which was noted as "DEBUG ONLY"
is now mandatory.  Doing this provides consistent management of the double
linked list of blocks under a freelist and makes this consolidation
of delete block code safe.  The first and last blocks will have NULL
pointers in their previous and next page pointers respectively.

Additionally, any time a block is removed from a free list the next and
previous pointers will be set to NULL to avoid misuse outside xvmalloc.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Acked-by: Nitin Gupta &lt;ngupta@vflare.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram: Return zero'd pages on new reads</title>
<updated>2011-02-04T21:29:12+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T15:00:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2787f959d6c5fb258d964218ac75346019f49ee9'/>
<id>2787f959d6c5fb258d964218ac75346019f49ee9</id>
<content type='text'>
Currently zram will do nothing to the page in the bvec when that page
has not been previously written.  This allows random data to leak to
user space.  That can be seen by doing the following:

 ## Load the module and create a 256Mb zram device called /dev/zram0
 # modprobe zram
 # echo $((256*1024*1024)) &gt; /sys/class/block/zram0/disksize

 ## Initialize the device by writing zero to the first block
 # dd if=/dev/zero of=/dev/zram0 bs=512 count=1

 ## Read ~256Mb of memory into a file and hope for something interesting
 # dd if=/dev/zram0 of=file

This patch will treat an unwritten page as a zero-filled page.  If a
page is read before a write has occurred the data returned is all 0's.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently zram will do nothing to the page in the bvec when that page
has not been previously written.  This allows random data to leak to
user space.  That can be seen by doing the following:

 ## Load the module and create a 256Mb zram device called /dev/zram0
 # modprobe zram
 # echo $((256*1024*1024)) &gt; /sys/class/block/zram0/disksize

 ## Initialize the device by writing zero to the first block
 # dd if=/dev/zero of=/dev/zram0 bs=512 count=1

 ## Read ~256Mb of memory into a file and hope for something interesting
 # dd if=/dev/zram0 of=file

This patch will treat an unwritten page as a zero-filled page.  If a
page is read before a write has occurred the data returned is all 0's.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram/xvmalloc: Close 32byte hole on 64bit CPUs</title>
<updated>2011-02-04T21:29:11+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T15:00:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=37700965858a099d250bca531ca1c99b22c8708d'/>
<id>37700965858a099d250bca531ca1c99b22c8708d</id>
<content type='text'>
By swapping the total_pages statistic with the lock we close a
hole in the structure for 64-bit CPUs.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By swapping the total_pages statistic with the lock we close a
hole in the structure for 64-bit CPUs.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram/xvmalloc: create CONFIG_ZRAM_DEBUG for debug code</title>
<updated>2011-02-04T21:29:11+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T14:59:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b1f5b81ebeee3974a8c793cafacace991d9a864d'/>
<id>b1f5b81ebeee3974a8c793cafacace991d9a864d</id>
<content type='text'>
Add a debug config flag to enable debug printk output and future
debug code.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a debug config flag to enable debug printk output and future
debug code.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram/xvmalloc: free bit block insertion optimization</title>
<updated>2011-02-04T21:29:11+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T14:58:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e3f201b541ff6748db77b857d2ae69fc9dbbee11'/>
<id>e3f201b541ff6748db77b857d2ae69fc9dbbee11</id>
<content type='text'>
This change is in a conditional block which is entered only when there is
an existing data block on the freelist where the insert has taken place.

The new block is pushed onto the freelist stack and this conditional block
is updating links in the prior stack head to point to the new stack head.
After this conditional block the first-/second-level indices are updated
to indicate that there is a free block at this location.

This patch adds an immediate return from the conditional block to avoid
setting bits again to indicate a free block on this freelist. The bits
would already be set because there was an existing free block on this
freelist.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change is in a conditional block which is entered only when there is
an existing data block on the freelist where the insert has taken place.

The new block is pushed onto the freelist stack and this conditional block
is updating links in the prior stack head to point to the new stack head.
After this conditional block the first-/second-level indices are updated
to indicate that there is a free block at this location.

This patch adds an immediate return from the conditional block to avoid
setting bits again to indicate a free block on this freelist. The bits
would already be set because there was an existing free block on this
freelist.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>zram: Prevent overflow in logical block size</title>
<updated>2011-02-04T21:29:11+00:00</updated>
<author>
<name>Robert Jennings</name>
<email>rcj@linux.vnet.ibm.com</email>
</author>
<published>2011-01-28T14:58:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7b19b8d45b216ff3186f066b31937bdbde066f08'/>
<id>7b19b8d45b216ff3186f066b31937bdbde066f08</id>
<content type='text'>
On a 64K page kernel, the value PAGE_SIZE passed to
blk_queue_logical_block_size would overflow the logical block size
argument (resulting in setting it to 0).

This patch sets the logical block size to 4096, using a new
ZRAM_LOGICAL_BLOCK_SIZE constant.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On a 64K page kernel, the value PAGE_SIZE passed to
blk_queue_logical_block_size would overflow the logical block size
argument (resulting in setting it to 0).

This patch sets the logical block size to 4096, using a new
ZRAM_LOGICAL_BLOCK_SIZE constant.

Signed-off-by: Robert Jennings &lt;rcj@linux.vnet.ibm.com&gt;
Reviewed-by: Pekka Enberg &lt;penberg@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
