<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/ext4/inline.c, branch v3.19</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.19</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.19'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-12-06T02:37:15Z</updated>
<entry>
<title>ext4: ext4_da_convert_inline_data_to_extent drop locked page after error</title>
<updated>2014-12-06T02:37:15Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2014-12-06T02:37:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=50db71abc529c48b21f4c3034d3cff27cfb25795'/>
<id>urn:sha1:50db71abc529c48b21f4c3034d3cff27cfb25795</id>
<content type='text'>
Testcase:
xfstests generic/270
MKFS_OPTIONS="-q -I 256 -O inline_data,64bit"

Call Trace:
 [&lt;ffffffff81144c76&gt;] lock_page+0x35/0x39 -------&gt; DEADLOCK
 [&lt;ffffffff81145260&gt;] pagecache_get_page+0x65/0x15a
 [&lt;ffffffff811507fc&gt;] truncate_inode_pages_range+0x1db/0x45c
 [&lt;ffffffff8120ea63&gt;] ? ext4_da_get_block_prep+0x439/0x4b6
 [&lt;ffffffff811b29b7&gt;] ? __block_write_begin+0x284/0x29c
 [&lt;ffffffff8120e62a&gt;] ? ext4_change_inode_journal_flag+0x16b/0x16b
 [&lt;ffffffff81150af0&gt;] truncate_inode_pages+0x12/0x14
 [&lt;ffffffff81247cb4&gt;] ext4_truncate_failed_write+0x19/0x25
 [&lt;ffffffff812488cf&gt;] ext4_da_write_inline_data_begin+0x196/0x31c
 [&lt;ffffffff81210dad&gt;] ext4_da_write_begin+0x189/0x302
 [&lt;ffffffff810c07ac&gt;] ? trace_hardirqs_on+0xd/0xf
 [&lt;ffffffff810ddd13&gt;] ? read_seqcount_begin.clone.1+0x9f/0xcc
 [&lt;ffffffff8114309d&gt;] generic_perform_write+0xc7/0x1c6
 [&lt;ffffffff810c040e&gt;] ? mark_held_locks+0x59/0x77
 [&lt;ffffffff811445d1&gt;] __generic_file_write_iter+0x17f/0x1c5
 [&lt;ffffffff8120726b&gt;] ext4_file_write_iter+0x2a5/0x354
 [&lt;ffffffff81185656&gt;] ? file_start_write+0x2a/0x2c
 [&lt;ffffffff8107bcdb&gt;] ? bad_area_nosemaphore+0x13/0x15
 [&lt;ffffffff811858ce&gt;] new_sync_write+0x8a/0xb2
 [&lt;ffffffff81186e7b&gt;] vfs_write+0xb5/0x14d
 [&lt;ffffffff81186ffb&gt;] SyS_write+0x5c/0x8c
 [&lt;ffffffff816f2529&gt;] system_call_fastpath+0x12/0x17

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: ext4_inline_data_fiemap should respect callers argument</title>
<updated>2014-12-02T21:11:20Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2014-12-02T21:11:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d952d69e268f833c85c0bafee9f67f9dba85044b'/>
<id>urn:sha1:d952d69e268f833c85c0bafee9f67f9dba85044b</id>
<content type='text'>
Currently ext4_inline_data_fiemap ignores requested arguments (start
and len) which may lead endless loop if start != 0.  Also fix incorrect
extent length determination.

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: prevent fsreentrance deadlock for inline_data</title>
<updated>2014-12-02T21:09:50Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2014-12-02T21:09:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175'/>
<id>urn:sha1:5cc28a9eaab21ce7ded7845b32e2eafc4bbeb175</id>
<content type='text'>
ext4_da_convert_inline_data_to_extent() invokes
grab_cache_page_write_begin().  grab_cache_page_write_begin performs
memory allocation, so fs-reentrance should be prohibited because we
are inside journal transaction.

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: Replace open coded mdata csum feature to helper function</title>
<updated>2014-10-13T07:36:16Z</updated>
<author>
<name>Dmitry Monakhov</name>
<email>dmonakhov@openvz.org</email>
</author>
<published>2014-10-13T07:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9aa5d32ba269bec0e7eaba2697a986a7b0bc8528'/>
<id>urn:sha1:9aa5d32ba269bec0e7eaba2697a986a7b0bc8528</id>
<content type='text'>
Besides the fact that this replacement improves code readability
it also protects from errors caused direct EXT4_S(sb)-&gt;s_es manipulation
which may result attempt to use uninitialized  csum machinery.

#Testcase_BEGIN
IMG=/dev/ram0
MNT=/mnt
mkfs.ext4 $IMG
mount $IMG $MNT
#Enable feature directly on disk, on mounted fs
tune2fs -O metadata_csum  $IMG
# Provoke metadata update, likey result in OOPS
touch $MNT/test
umount $MNT
#Testcase_END

# Replacement script
@@
expression E;
@@
- EXT4_HAS_RO_COMPAT_FEATURE(E, EXT4_FEATURE_RO_COMPAT_METADATA_CSUM)
+ ext4_has_metadata_csum(E)

https://bugzilla.kernel.org/show_bug.cgi?id=82201

Signed-off-by: Dmitry Monakhov &lt;dmonakhov@openvz.org&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ext4: don't keep using page if inline conversion fails</title>
<updated>2014-09-11T15:45:12Z</updated>
<author>
<name>Darrick J. Wong</name>
<email>darrick.wong@oracle.com</email>
</author>
<published>2014-09-11T15:45:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=684de5748660e16e185754697ac0afa9e18297f6'/>
<id>urn:sha1:684de5748660e16e185754697ac0afa9e18297f6</id>
<content type='text'>
If inline-&gt;extent conversion fails (most probably due to ENOSPC) and
we release the temporary page that we allocated to transfer the file
contents, don't keep using the page pointer after releasing the page.
This occasionally leads to complaints about evicting locked pages or
hangs when blocksize &gt; pagesize, because it's possible for the page to
get reallocated elsewhere in the meantime.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Jan Kara &lt;jack@suse.cz&gt;
Cc: Tao Ma &lt;tm@tao.ma&gt;
</content>
</entry>
<entry>
<title>ext4: check inline directory before converting</title>
<updated>2014-07-28T17:06:26Z</updated>
<author>
<name>Darrick J. Wong</name>
<email>darrick.wong@oracle.com</email>
</author>
<published>2014-07-28T17:06:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=40b163f1c45f52752677e66d2fd273dbfd273a22'/>
<id>urn:sha1:40b163f1c45f52752677e66d2fd273dbfd273a22</id>
<content type='text'>
Before converting an inline directory to a regular directory, check
the directory entries to make sure they're not obviously broken.
This helps us to avoid a BUG_ON if one of the dirents is trashed.

Signed-off-by: Darrick J. Wong &lt;darrick.wong@oracle.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
Reviewed-by: Andreas Dilger &lt;adilger@dilger.ca&gt;
</content>
</entry>
<entry>
<title>ext4: make ext4_has_inline_data() as a inline function</title>
<updated>2014-07-15T14:10:04Z</updated>
<author>
<name>Zheng Liu</name>
<email>wenqing.lz@taobao.com</email>
</author>
<published>2014-07-15T14:10:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=83447ccb4df6e6051027bedff2a8cfc6a52ebcf8'/>
<id>urn:sha1:83447ccb4df6e6051027bedff2a8cfc6a52ebcf8</id>
<content type='text'>
Now ext4_has_inline_data() is used in wide spread codepaths.  So we need
to make it as a inline function to avoid burning some CPU cycles.

Change in text size:

         text     data      bss     dec     hex filename
before: 326110    19258    5528  350896   55ab0 fs/ext4/ext4.o
after:  326227    19258    5528  351013   55b25 fs/ext4/ext4.o

I use the following script to measure the CPU usage.

  #!/bin/bash

  shm_base='/dev/shm'
  img=${shm_base}/ext4-img
  mnt=/mnt/loop

  e2fsprgs_base=$HOME/e2fsprogs
  mkfs=${e2fsprgs_base}/misc/mke2fs
  fsck=${e2fsprgs_base}/e2fsck/e2fsck

  sudo umount $mnt
  dd if=/dev/zero of=$img bs=4k count=3145728
  ${mkfs} -t ext4 -O inline_data -F $img
  sudo mount -t ext4 -o loop $img $mnt

  # start testing...
  testdir="${mnt}/testdir"
  mkdir $testdir
  cd $testdir

  echo "start testing..."
  for ((cnt=0;cnt&lt;100;cnt++)); do

  for ((i=0;i&lt;5;i++)); do
  	for ((j=0;j&lt;5;j++)); do
  		for ((k=0;k&lt;5;k++)); do
  			for ((l=0;l&lt;5;l++)); do
  				mkdir -p $i/$j/$k/$l
  				echo "$i-$j-$k-$l" &gt; $i/$j/$k/$l/testfile
  			done
  		done
  	done
  done

  ls -R $testdir &gt; /dev/null
  rm -rf $testdir/*

  done

The result of `perf top -G -U` is as below.

vanilla:
 13.92%  [ext4]  [k] ext4_do_update_inode
  9.36%  [ext4]  [k] __ext4_get_inode_loc
  4.07%  [ext4]  [k] ftrace_define_fields_ext4_writepages
  3.83%  [ext4]  [k] __ext4_handle_dirty_metadata
  3.42%  [ext4]  [k] ext4_get_inode_flags
  2.71%  [ext4]  [k] ext4_mark_iloc_dirty
  2.46%  [ext4]  [k] ftrace_define_fields_ext4_direct_IO_enter
  2.26%  [ext4]  [k] ext4_get_inode_loc
  2.22%  [ext4]  [k] ext4_has_inline_data
  [...]

After applied the patch, we don't see ext4_has_inline_data() because it
has been inlined and perf couldn't sample it.  Although it doesn't mean
that the CPU cycles can be saved but at least the overhead of function
calls can be eliminated.  So IMHO we'd better inline this function.

Cc: Andreas Dilger &lt;adilger.kernel@dilger.ca&gt;
Signed-off-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
Signed-off-by: Theodore Ts'o &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: add missing BUFFER_TRACE before ext4_journal_get_write_access</title>
<updated>2014-05-13T02:06:43Z</updated>
<author>
<name>liang xie</name>
<email>xieliang007@gmail.com</email>
</author>
<published>2014-05-13T02:06:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5d60125530b0122f5a0a57481f3064a6250365dd'/>
<id>urn:sha1:5d60125530b0122f5a0a57481f3064a6250365dd</id>
<content type='text'>
Make them more consistently

Signed-off-by: xieliang &lt;xieliang@xiaomi.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: make local functions static</title>
<updated>2014-05-12T14:50:23Z</updated>
<author>
<name>Stephen Hemminger</name>
<email>stephen@networkplumber.org</email>
</author>
<published>2014-05-12T14:50:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c197855ea14175a25003c276824689e8ba318e53'/>
<id>urn:sha1:c197855ea14175a25003c276824689e8ba318e53</id>
<content type='text'>
I have been running make namespacecheck to look for unneeded globals, and
found these in ext4.

Signed-off-by: Stephen Hemminger &lt;stephen@networkplumber.org&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
</content>
</entry>
<entry>
<title>ext4: delete "set but not used" variables</title>
<updated>2014-01-11T18:26:56Z</updated>
<author>
<name>jon ernst</name>
<email>jonernst07@gmail.com</email>
</author>
<published>2014-01-11T18:26:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d7092ae2973f20a39fee786c47e5edf18ced088f'/>
<id>urn:sha1:d7092ae2973f20a39fee786c47e5edf18ced088f</id>
<content type='text'>
Signed-off-by: Jon Ernst &lt;jonernst07@gmail.com&gt;
Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Reviewed-by: Zheng Liu &lt;wenqing.lz@taobao.com&gt;
</content>
</entry>
</feed>
