<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/fs/f2fs/debug.c, branch v3.8</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>f2fs: fix the debugfs entry creation path</title>
<updated>2013-01-15T11:19:15+00:00</updated>
<author>
<name>Namjae Jeon</name>
<email>linkinjeon@gmail.com</email>
</author>
<published>2013-01-15T10:58:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4589d25d015c2d02bb5f7075d0cbf6dcf23a33c0'/>
<id>4589d25d015c2d02bb5f7075d0cbf6dcf23a33c0</id>
<content type='text'>
As the "status" debugfs entry will be maintained for entire F2FS filesystem
irrespective of the number of partitions.
So, we can move the initialization to the init part of the f2fs and destroy will
be done from exit part. After making changes, for individual partition mount -
entry creation code will not be executed.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Amit Sahrawat &lt;a.sahrawat@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As the "status" debugfs entry will be maintained for entire F2FS filesystem
irrespective of the number of partitions.
So, we can move the initialization to the init part of the f2fs and destroy will
be done from exit part. After making changes, for individual partition mount -
entry creation code will not be executed.

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
Signed-off-by: Namjae Jeon &lt;namjae.jeon@samsung.com&gt;
Signed-off-by: Amit Sahrawat &lt;a.sahrawat@samsung.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: add global mutex_lock to protect f2fs_stat_list</title>
<updated>2013-01-15T11:18:29+00:00</updated>
<author>
<name>majianpeng</name>
<email>majianpeng@gmail.com</email>
</author>
<published>2013-01-14T12:08:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=66af62ce7588736ae65edfdb1c0df597775c4d21'/>
<id>66af62ce7588736ae65edfdb1c0df597775c4d21</id>
<content type='text'>
There is an race condition between umounting f2fs and reading f2fs/status, which
results in oops.

Fox example:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
				 list_for_each_entry_safe(&amp;f2fs_stat_list)
 list_del(&amp;si-&gt;stat_list);
 mutex_lock(&amp;si-&gt;stat_lock);
 si-&gt;sbi = NULL;
 mutex_unlock(&amp;si-&gt;stat_lock);
 kfree(sbi-&gt;stat_info);
} 				 mutex_lock(&amp;si-&gt;stat_lock) &lt;- si is gone.
				 ...
				}

Solution with a global lock: f2fs_stat_mutex:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
 mutex_lock(&amp;f2fs_stat_mutex);
 list_del(&amp;si-&gt;stat_list);
 mutex_unlock(&amp;f2fs_stat_mutex);
 kfree(sbi-&gt;stat_info);		 mutex_lock(&amp;f2fs_stat_mutex);
}				 list_for_each_entry_safe(&amp;f2fs_stat_list)
				 ...
				 mutex_unlock(&amp;f2fs_stat_mutex);
				}

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
[jaegeuk.kim@samsung.com: fix typos, description, and remove the existing lock]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is an race condition between umounting f2fs and reading f2fs/status, which
results in oops.

Fox example:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
				 list_for_each_entry_safe(&amp;f2fs_stat_list)
 list_del(&amp;si-&gt;stat_list);
 mutex_lock(&amp;si-&gt;stat_lock);
 si-&gt;sbi = NULL;
 mutex_unlock(&amp;si-&gt;stat_lock);
 kfree(sbi-&gt;stat_info);
} 				 mutex_lock(&amp;si-&gt;stat_lock) &lt;- si is gone.
				 ...
				}

Solution with a global lock: f2fs_stat_mutex:
Thread A			Thread B
umount f2fs 			cat f2fs/status

f2fs_destroy_stats() {		stat_show() {
 mutex_lock(&amp;f2fs_stat_mutex);
 list_del(&amp;si-&gt;stat_list);
 mutex_unlock(&amp;f2fs_stat_mutex);
 kfree(sbi-&gt;stat_info);		 mutex_lock(&amp;f2fs_stat_mutex);
}				 list_for_each_entry_safe(&amp;f2fs_stat_list)
				 ...
				 mutex_unlock(&amp;f2fs_stat_mutex);
				}

Signed-off-by: Jianpeng Ma &lt;majianpeng@gmail.com&gt;
[jaegeuk.kim@samsung.com: fix typos, description, and remove the existing lock]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: update f2fs partition info about SIT/NAT layout</title>
<updated>2013-01-04T00:42:59+00:00</updated>
<author>
<name>Huajun Li</name>
<email>huajun.li.lee@gmail.com</email>
</author>
<published>2012-12-31T05:59:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7880ceedec55fbc3997d80e68670d03395225367'/>
<id>7880ceedec55fbc3997d80e68670d03395225367</id>
<content type='text'>
Update partition info output under debug FS to reflect segment layout correctly.

Signed-off-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update partition info output under debug FS to reflect segment layout correctly.

Signed-off-by: Huajun Li &lt;huajun.li.lee@gmail.com&gt;
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: adjust kernel coding style</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2012-11-29T04:28:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0a8165d7c2cf1395059db20ab07665baf3758fcd'/>
<id>0a8165d7c2cf1395059db20ab07665baf3758fcd</id>
<content type='text'>
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment
blocks. Instead, just use "/*".

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As pointed out by Randy Dunlap, this patch removes all usage of "/**" for comment
blocks. Instead, just use "/*".

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: fix endian conversion bugs reported by sparse</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Jaegeuk Kim</name>
<email>jaegeuk.kim@samsung.com</email>
</author>
<published>2012-11-28T07:12:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=25ca923b2a766b9c93b63777ead351137533a623'/>
<id>25ca923b2a766b9c93b63777ead351137533a623</id>
<content type='text'>
This patch should resolve the bugs reported by the sparse tool.
Initial reports were written by "kbuild test robot" managed by fengguang.wu.

In my local machines, I've tested also by running:
&gt; make C=2 CF="-D__CHECK_ENDIAN__"

Accordingly, I've found lots of warnings and bugs related to the endian
conversion. And I've fixed all at this moment.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch should resolve the bugs reported by the sparse tool.
Initial reports were written by "kbuild test robot" managed by fengguang.wu.

In my local machines, I've tested also by running:
&gt; make C=2 CF="-D__CHECK_ENDIAN__"

Accordingly, I've found lots of warnings and bugs related to the endian
conversion. And I've fixed all at this moment.

Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>f2fs: move proc files to debugfs</title>
<updated>2012-12-11T04:43:42+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-11-02T21:50:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=902829aa0b722511369e4e6193e66390bc58e0a2'/>
<id>902829aa0b722511369e4e6193e66390bc58e0a2</id>
<content type='text'>
This moves all of the f2fs debugging files into debugfs. The files are
located in /sys/kernel/debug/f2fs/

Note, I think we are generating all of the same information in each of
the files for every unique f2fs filesystem in the machine.  This copies
the functionality that was present in the proc files, but this should be
fixed up in the future.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[jaegeuk.kim@samsung.com: merged 3 debugfs entries into a *status* entry]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves all of the f2fs debugging files into debugfs. The files are
located in /sys/kernel/debug/f2fs/

Note, I think we are generating all of the same information in each of
the files for every unique f2fs filesystem in the machine.  This copies
the functionality that was present in the proc files, but this should be
fixed up in the future.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
[jaegeuk.kim@samsung.com: merged 3 debugfs entries into a *status* entry]
Signed-off-by: Jaegeuk Kim &lt;jaegeuk.kim@samsung.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
