<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/git/stable/linux.git/fs/nfs/blocklayout/extents.c, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<id>https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master</id>
<link rel='self' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/'/>
<updated>2014-09-10T19:47:03+00:00</updated>
<entry>
<title>pnfs/blocklayout: rewrite extent tracking</title>
<updated>2014-09-10T19:47:03+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2014-09-10T15:23:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8067253c8cc531b6f367b9f5942bdc6168385701'/>
<id>urn:sha1:8067253c8cc531b6f367b9f5942bdc6168385701</id>
<content type='text'>
Currently the block layout driver tracks extents in three separate
data structures:

 - the two list of pnfs_block_extent structures returned by the server
 - the list of sectors that were in invalid state but have been written to
 - a list of pnfs_block_short_extent structures for LAYOUTCOMMIT

All of these share the property that they are not only highly inefficient
data structures, but also that operations on them are even more inefficient
than nessecary.

In addition there are various implementation defects like:

 - using an int to track sectors, causing corruption for large offsets
 - incorrect normalization of page or block granularity ranges
 - insufficient error handling
 - incorrect synchronization as extents can be modified while they are in
   use

This patch replace all three data with a single unified rbtree structure
tracking all extents, as well as their in-memory state, although we still
need to instance for read-only and read-write extent due to the arcane
client side COW feature in the block layouts spec.

To fix the problem of extent possibly being modified while in use we make
sure to return a copy of the extent for use in the write path - the
extent can only be invalidated by a layout recall or return which has
to wait until the I/O operations finished due to refcounts on the layout
segment.

The new extent tree work similar to the schemes used by block based
filesystems like XFS or ext4.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Trond Myklebust &lt;trond.myklebust@primarydata.com&gt;
</content>
</entry>
<entry>
<title>nfs: fix do_div() warning by instead using sector_div()</title>
<updated>2013-12-04T17:57:37+00:00</updated>
<author>
<name>Helge Deller</name>
<email>deller@gmx.de</email>
</author>
<published>2013-12-02T18:59:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3873d064b8538686bbbd4b858dc8a07db1f7f43a'/>
<id>urn:sha1:3873d064b8538686bbbd4b858dc8a07db1f7f43a</id>
<content type='text'>
When compiling a 32bit kernel with CONFIG_LBDAF=n the compiler complains like
shown below.  Fix this warning by instead using sector_div() which is provided
by the kernel.h header file.

fs/nfs/blocklayout/extents.c: In function ‘normalize’:
include/asm-generic/div64.h:43:28: warning: comparison of distinct pointer types lacks a cast [enabled by default]
fs/nfs/blocklayout/extents.c:47:13: note: in expansion of macro ‘do_div’
nfs/blocklayout/extents.c:47:2: warning: right shift count &gt;= width of type [enabled by default]
fs/nfs/blocklayout/extents.c:47:2: warning: passing argument 1 of ‘__div64_32’ from incompatible pointer type [enabled by default]
include/asm-generic/div64.h:35:17: note: expected ‘uint64_t *’ but argument is of type ‘sector_t *’
 extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);

Signed-off-by: Helge Deller &lt;deller@gmx.de&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: use list_move_tail instead of list_del/list_add_tail</title>
<updated>2012-10-01T22:39:05+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>yongjun_wei@trendmicro.com.cn</email>
</author>
<published>2012-09-05T06:38:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=4e266229dbb0782d91b75633322edd632794b86d'/>
<id>urn:sha1:4e266229dbb0782d91b75633322edd632794b86d</id>
<content type='text'>
Using list_move_tail() instead of list_del() + list_add_tail().

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun &lt;yongjun_wei@trendmicro.com.cn&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>NFS: Use kcalloc() when allocating arrays</title>
<updated>2012-02-01T00:28:22+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2012-01-20T23:57:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7d9dea915fe333357912bce2d624ee848dfbd890'/>
<id>urn:sha1:7d9dea915fe333357912bce2d624ee848dfbd890</id>
<content type='text'>
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: alloc short extent before submit bio</title>
<updated>2012-01-12T21:52:10+00:00</updated>
<author>
<name>Peng Tao</name>
<email>bergwolf@gmail.com</email>
</author>
<published>2012-01-12T15:18:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7c5465d6ccd759caa959828e2add5603518dafc4'/>
<id>urn:sha1:7c5465d6ccd759caa959828e2add5603518dafc4</id>
<content type='text'>
As discussed earlier, it is better for block client to allocate memory for
tracking extents state before submitting bio. So the patch does it by allocating
a short_extent for every INVALID extent touched by write pagelist and for
every zeroing page we created, saving them in layout header. Then in end_io we
can just use them to create commit list items and avoid memory allocation there.

Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: cleanup bl_mark_sectors_init</title>
<updated>2012-01-12T21:52:09+00:00</updated>
<author>
<name>Peng Tao</name>
<email>bergwolf@gmail.com</email>
</author>
<published>2012-01-12T15:18:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=60c52e3a72fda10e82f38b6f979956eb2dcb3d4e'/>
<id>urn:sha1:60c52e3a72fda10e82f38b6f979956eb2dcb3d4e</id>
<content type='text'>
It does not need to manipulate on partial initialized blocks.
Writeback code takes care of it.

Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: clean up _add_entry</title>
<updated>2012-01-12T21:38:55+00:00</updated>
<author>
<name>Peng Tao</name>
<email>bergwolf@gmail.com</email>
</author>
<published>2012-01-12T15:18:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=57582b372f63d0f655b1a35b0d306d73d1a46775'/>
<id>urn:sha1:57582b372f63d0f655b1a35b0d306d73d1a46775</id>
<content type='text'>
It is wrong to kmalloc in _add_entry() as it is inside
spinlock. memory should be already allocated _add_entry() is called.

Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: acquire im_lock in _preload_range</title>
<updated>2012-01-12T21:38:49+00:00</updated>
<author>
<name>Peng Tao</name>
<email>bergwolf@gmail.com</email>
</author>
<published>2012-01-12T15:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=39e567ae36fe03c2b446e1b83ee3d39bea08f90b'/>
<id>urn:sha1:39e567ae36fe03c2b446e1b83ee3d39bea08f90b</id>
<content type='text'>
When calling _add_entry, we should take the im_lock to protect
agains other modifiers.

Cc: &lt;stable@vger.kernel.org&gt; #3.1+
Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: note written INVAL areas for layoutcommit</title>
<updated>2011-07-31T16:18:17+00:00</updated>
<author>
<name>Fred Isaman</name>
<email>iisaman@citi.umich.edu</email>
</author>
<published>2011-07-31T00:52:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=31e6306a4046926b598484f1cacf69309382eac6'/>
<id>urn:sha1:31e6306a4046926b598484f1cacf69309382eac6</id>
<content type='text'>
Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
Signed-off-by: Fred Isaman &lt;iisaman@citi.umich.edu&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@panasas.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Jim Rees &lt;rees@umich.edu&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
<entry>
<title>pnfsblock: cleanup_layoutcommit</title>
<updated>2011-07-31T16:18:17+00:00</updated>
<author>
<name>Fred Isaman</name>
<email>iisaman@citi.umich.edu</email>
</author>
<published>2011-07-31T00:52:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.rulkc.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b2be7811dd94816f3df76708c8eb7f55bf7289e2'/>
<id>urn:sha1:b2be7811dd94816f3df76708c8eb7f55bf7289e2</id>
<content type='text'>
In blocklayout driver. There are two things happening
while layoutcommit/cleanup.
1. the modified extents are encoded.
2. On cleanup the extents are put back on the layout rw
   extents list, for reads.

In the new system where actual xdr encoding is done in
encode_layoutcommit() directly into xdr buffer, these are
the new commit stages:

1. On setup_layoutcommit, the range is adjusted as before
   and a structure is allocated for communication with
   bl_encode_layoutcommit &amp;&amp; bl_cleanup_layoutcommit
   (Generic layer provides a void-star to hang it on)

2. bl_encode_layoutcommit is called to do the actual
   encoding directly into xdr. The commit-extent-list is not
   freed and is stored on above structure.
   FIXME: The code is not yet converted to the new XDR cleanup

3. On cleanup the commit-extent-list is put back by a call
   to set_to_rw() as before, but with no need for XDR decoding
   of the list as before. And the commit-extent-list is freed.
   Finally allocated structure is freed.

[rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()]
Signed-off-by: Jim Rees &lt;rees@umich.edu&gt;
[pnfsblock: introduce bl_committing list]
Signed-off-by: Peng Tao &lt;peng_tao@emc.com&gt;
[pnfsblock: SQUASHME: adjust to API change]
Signed-off-by: Fred Isaman &lt;iisaman@citi.umich.edu&gt;
[blocklayout: encode_layoutcommit implementation]
Signed-off-by: Boaz Harrosh &lt;bharrosh@panasas.com&gt;
[pnfsblock: fix bug setting up layoutcommit.]
Signed-off-by: Tao Guo &lt;guotao@nrchpc.ac.cn&gt;
[pnfsblock: cleanup_layoutcommit wants a status parameter]
Signed-off-by: Boaz Harrosh &lt;bharrosh@panasas.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@panasas.com&gt;
Signed-off-by: Benny Halevy &lt;bhalevy@tonian.com&gt;
Signed-off-by: Jim Rees &lt;rees@umich.edu&gt;
Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
</content>
</entry>
</feed>
