<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/nilfs2/segment.c, branch linux-2.6.30.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-08-16T21:18:34Z</updated>
<entry>
<title>nilfs2: fix oops due to inconsistent state in page with discrete b-tree nodes</title>
<updated>2009-08-16T21:18:34Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-07-28T08:55:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=24761757735bec5aceb9f405cb6aa643765f9f78'/>
<id>urn:sha1:24761757735bec5aceb9f405cb6aa643765f9f78</id>
<content type='text'>
commit a97778457f22181e8c38c4cd7d7e528378738a98 upstream.

Andrea Gelmini gave me a report that a kernel oops hit on a nilfs
filesystem with a 1KB block size when doing rsync.

This turned out to be caused by an inconsistency of dirty state
between a page and its buffers storing b-tree node blocks.

If the page had multiple buffers split over multiple logs, and if the
logs were written at a time, a dirty flag remained in the page even
every dirty flag in the buffers was cleared.

This will fix the failure by dropping the dirty flag properly for
pages with the discrete multiple b-tree nodes.

Reported-by: Andrea Gelmini &lt;andrea.gelmini@gmail.com&gt;
Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Tested-by: Andrea Gelmini &lt;andrea.gelmini@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nilfs2: fix hang problem of log writer which occurs after write failures</title>
<updated>2009-07-30T21:39:48Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-06-18T14:52:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=def5dcb823a26bab8f1dc6b21b904c7de8e37bca'/>
<id>urn:sha1:def5dcb823a26bab8f1dc6b21b904c7de8e37bca</id>
<content type='text'>
commit 8227b29722fdbac72357aae155d171a5c777670c upstream.

Leandro Lucarella gave me a report that nilfs gets stuck after its
write function fails.

The problem turned out to be caused by bugs which leave writeback flag
on pages.  This fixes the problem by ensuring to clear the writeback
flag in error path.

Reported-by: Leandro Lucarella &lt;llucax@gmail.com&gt;
Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nilfs2: remove unlikely directive causing mis-conversion of error code</title>
<updated>2009-07-30T21:39:47Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-06-18T02:42:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f76cea526e01055bedb51a2b318f4d711e0144c4'/>
<id>urn:sha1:f76cea526e01055bedb51a2b318f4d711e0144c4</id>
<content type='text'>
commit 0cfae3d8795f388f9de78adb0171520d19da77e9 upstream.

The following error code handling in nilfs_segctor_write() function
wrongly converted negative error codes to a truth value (i.e. 1):

   err = unlikely(err) ? : res;

which originaly meant to be

   err = err ? : res;

This mis-conversion caused that write or sync functions receive the
unexpected error code.  This fixes the bug by removing the unlikely
directive.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>nilfs2: fix lock order reversal in nilfs_clean_segments ioctl</title>
<updated>2009-05-11T05:54:41Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-05-10T13:41:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4f6b828837b4e3836f2c9ac2f0eab9773b6c1327'/>
<id>urn:sha1:4f6b828837b4e3836f2c9ac2f0eab9773b6c1327</id>
<content type='text'>
This is a companion patch to ("nilfs2: fix possible circular locking
for get information ioctls").

This corrects lock order reversal between mm-&gt;mmap_sem and
nilfs-&gt;ns_segctor_sem in nilfs_clean_segments() which was detected by
lockdep check:

 =======================================================
 [ INFO: possible circular locking dependency detected ]
 2.6.30-rc3-nilfs-00003-g360bdc1 #7
 -------------------------------------------------------
 mmap/5294 is trying to acquire lock:
  (&amp;nilfs-&gt;ns_segctor_sem){++++.+}, at: [&lt;d0d0e846&gt;] nilfs_transaction_begin+0xb6/0x10c [nilfs2]

 but task is already holding lock:
  (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;c043700a&gt;] do_page_fault+0x1d8/0x30a

 which lock already depends on the new lock.

 the existing dependency chain (in reverse order) is:

 -&gt; #1 (&amp;mm-&gt;mmap_sem){++++++}:
        [&lt;c01470a5&gt;] __lock_acquire+0x1066/0x13b0
        [&lt;c01474a9&gt;] lock_acquire+0xba/0xdd
        [&lt;c01836bc&gt;] might_fault+0x68/0x88
        [&lt;c023c61d&gt;] copy_from_user+0x2a/0x111
        [&lt;d0d120d0&gt;] nilfs_ioctl_prepare_clean_segments+0x1d/0xf1 [nilfs2]
        [&lt;d0d0e2aa&gt;] nilfs_clean_segments+0x6d/0x1b9 [nilfs2]
        [&lt;d0d11f68&gt;] nilfs_ioctl+0x2ad/0x318 [nilfs2]
        [&lt;c01a3be7&gt;] vfs_ioctl+0x22/0x69
        [&lt;c01a408e&gt;] do_vfs_ioctl+0x460/0x499
        [&lt;c01a4107&gt;] sys_ioctl+0x40/0x5a
        [&lt;c01031a4&gt;] sysenter_do_call+0x12/0x38
        [&lt;ffffffff&gt;] 0xffffffff

 -&gt; #0 (&amp;nilfs-&gt;ns_segctor_sem){++++.+}:
        [&lt;c0146e0b&gt;] __lock_acquire+0xdcc/0x13b0
        [&lt;c01474a9&gt;] lock_acquire+0xba/0xdd
        [&lt;c0433f1d&gt;] down_read+0x2a/0x3e
        [&lt;d0d0e846&gt;] nilfs_transaction_begin+0xb6/0x10c [nilfs2]
        [&lt;d0cfe0e5&gt;] nilfs_page_mkwrite+0xe7/0x154 [nilfs2]
        [&lt;c0183b0b&gt;] __do_fault+0x165/0x376
        [&lt;c01855cd&gt;] handle_mm_fault+0x287/0x5d1
        [&lt;c043712d&gt;] do_page_fault+0x2fb/0x30a
        [&lt;c0435462&gt;] error_code+0x72/0x78
        [&lt;ffffffff&gt;] 0xffffffff

where nilfs_clean_segments() holds:

  nilfs-&gt;ns_segctor_sem -&gt; copy_from_user()
                             --&gt; page fault -&gt; mm-&gt;mmap_sem

And, page fault path may hold:

  page fault -&gt; mm-&gt;mmap_sem
         --&gt; nilfs_page_mkwrite() -&gt; nilfs-&gt;ns_segctor_sem

Even though nilfs_clean_segments() does not perform write access on
given user pages, it may cause deadlock because nilfs-&gt;ns_segctor_sem
is shared per device and mm-&gt;mmap_sem can be shared with other tasks.

To avoid this problem, this patch moves all calls of copy_from_user()
outside the nilfs-&gt;ns_segctor_sem lock in the ioctl.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
</content>
</entry>
<entry>
<title>nilfs2: introduce secondary super block</title>
<updated>2009-04-07T15:31:20Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e339ad31f59925b48a92ee3947692fdf9758b8c7'/>
<id>urn:sha1:e339ad31f59925b48a92ee3947692fdf9758b8c7</id>
<content type='text'>
The former versions didn't have extra super blocks.  This improves the
weak point by introducing another super block at unused region in tail of
the partition.

This doesn't break disk format compatibility; older versions just ingore
the secondary super block, and new versions just recover it if it doesn't
exist.  The partition created by an old mkfs may not have unused region,
but in that case, the secondary super block will not be added.

This doesn't make more redundant copies of the super block; it is a future
work.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nilfs2: simplify handling of active state of segments</title>
<updated>2009-04-07T15:31:20Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cece552074c591970353ad48308d65f110aeaf28'/>
<id>urn:sha1:cece552074c591970353ad48308d65f110aeaf28</id>
<content type='text'>
will reduce some lines of segment constructor.  Previously, the state was
complexly controlled through a list of segments in order to keep
consistency in meta data of usage state of segments.  Instead, this
presents ``calculated'' active flags to userland cleaner program and stop
maintaining its real flag on disk.

Only by this fake flag, the cleaner cannot exactly know if each segment is
reclaimable or not.  However, the recent extension of nilfs_sustat ioctl
struct (nilfs2-extend-nilfs_sustat-ioctl-struct.patch) can prevent the
cleaner from reclaiming in-use segment wrongly.

So, now I can apply this for simplification.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nilfs2: mark minor flag for checkpoint created by internal operation</title>
<updated>2009-04-07T15:31:19Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c96fa464a567a2a8796009af0e79bc68af73f485'/>
<id>urn:sha1:c96fa464a567a2a8796009af0e79bc68af73f485</id>
<content type='text'>
Nilfs creates checkpoints even for garbage collection or metadata updates
such as checkpoint mode change.  So, user often sees checkpoints created
only by such internal operations.

This is inconvenient in some situations.  For example, application that
monitors checkpoints and changes them to snapshots, will fall into an
infinite loop because it cannot distinguish internally created
checkpoints.

This patch solves this sort of problem by adding a flag to checkpoint for
identification.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nilfs2: clean up sketch file</title>
<updated>2009-04-07T15:31:19Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=458c5b0822a669d170fdb7bb16c9145f652ebe06'/>
<id>urn:sha1:458c5b0822a669d170fdb7bb16c9145f652ebe06</id>
<content type='text'>
The sketch file is a file to mark checkpoints with user data.  It was
experimentally introduced in the original implementation, and now
obsolete.  The file was handled differently with regular files; the file
size got truncated when a checkpoint was created.

This stops the special treatment and will treat it as a regular file.
Most users are not affected because mkfs.nilfs2 no longer makes this file.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nilfs2: replace BUG_ON and BUG calls triggerable from ioctl</title>
<updated>2009-04-07T15:31:19Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f5abe7e7dbcd83e73212c6cb135a6106cea6a0b'/>
<id>urn:sha1:1f5abe7e7dbcd83e73212c6cb135a6106cea6a0b</id>
<content type='text'>
Pekka Enberg advised me:
&gt; It would be nice if BUG(), BUG_ON(), and panic() calls would be
&gt; converted to proper error handling using WARN_ON() calls. The BUG()
&gt; call in nilfs_cpfile_delete_checkpoints(), for example, looks to be
&gt; triggerable from user-space via the ioctl() system call.

This will follow the comment and keep them to a minimum.

Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>nilfs2: extend nilfs_sustat ioctl struct</title>
<updated>2009-04-07T15:31:19Z</updated>
<author>
<name>Ryusuke Konishi</name>
</author>
<published>2009-04-07T02:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2c2e52fc4fca251e68f90821c9ff5cb18be4df58'/>
<id>urn:sha1:2c2e52fc4fca251e68f90821c9ff5cb18be4df58</id>
<content type='text'>
This adds a new argument to the nilfs_sustat structure.

The extended field allows to delete volatile active state of segments,
which was needed to protect freshly-created segments from garbage
collection but has confused code dealing with segments.  This
extension alleviates the mess and gives room for further
simplifications.

The volatile active flag is not persistent, so it's eliminable on this
occasion without affecting compatibility other than the ioctl change.

Signed-off-by: Ryusuke Konishi &lt;konishi.ryusuke@lab.ntt.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
