<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/fs-writeback.c, branch v3.4.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/fs-writeback.c?h=v3.4.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/fs-writeback.c?h=v3.4.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-12T20:38:49Z</updated>
<entry>
<title>ext4: fix potential deadlock in ext4_nonda_switch()</title>
<updated>2012-10-12T20:38:49Z</updated>
<author>
<name>Theodore Ts'o</name>
<email>tytso@mit.edu</email>
</author>
<published>2012-09-20T02:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=78790d120fd2a6ffa39dc23e57fdf9133e67b14c'/>
<id>urn:sha1:78790d120fd2a6ffa39dc23e57fdf9133e67b14c</id>
<content type='text'>
commit 00d4e7362ed01987183e9528295de3213031309c upstream.

In ext4_nonda_switch(), if the file system is getting full we used to
call writeback_inodes_sb_if_idle().  The problem is that we can be
holding i_mutex already, and this causes a potential deadlock when
writeback_inodes_sb_if_idle() when it tries to take s_umount.  (See
lockdep output below).

As it turns out we don't need need to hold s_umount; the fact that we
are in the middle of the write(2) system call will keep the superblock
pinned.  Unfortunately writeback_inodes_sb() checks to make sure
s_umount is taken, and the VFS uses a different mechanism for making
sure the file system doesn't get unmounted out from under us.  The
simplest way of dealing with this is to just simply grab s_umount
using a trylock, and skip kicking the writeback flusher thread in the
very unlikely case that we can't take a read lock on s_umount without
blocking.

Also, we now check the cirteria for kicking the writeback thread
before we decide to whether to fall back to non-delayed writeback, so
if there are any outstanding delayed allocation writes, we try to get
them resolved as soon as possible.

   [ INFO: possible circular locking dependency detected ]
   3.6.0-rc1-00042-gce894ca #367 Not tainted
   -------------------------------------------------------
   dd/8298 is trying to acquire lock:
    (&amp;type-&gt;s_umount_key#18){++++..}, at: [&lt;c02277d4&gt;] writeback_inodes_sb_if_idle+0x28/0x46

   but task is already holding lock:
    (&amp;sb-&gt;s_type-&gt;i_mutex_key#8){+.+...}, at: [&lt;c01ddcce&gt;] generic_file_aio_write+0x5f/0xd3

   which lock already depends on the new lock.

   2 locks held by dd/8298:
    #0:  (sb_writers#2){.+.+.+}, at: [&lt;c01ddcc5&gt;] generic_file_aio_write+0x56/0xd3
    #1:  (&amp;sb-&gt;s_type-&gt;i_mutex_key#8){+.+...}, at: [&lt;c01ddcce&gt;] generic_file_aio_write+0x5f/0xd3

   stack backtrace:
   Pid: 8298, comm: dd Not tainted 3.6.0-rc1-00042-gce894ca #367
   Call Trace:
    [&lt;c015b79c&gt;] ? console_unlock+0x345/0x372
    [&lt;c06d62a1&gt;] print_circular_bug+0x190/0x19d
    [&lt;c019906c&gt;] __lock_acquire+0x86d/0xb6c
    [&lt;c01999db&gt;] ? mark_held_locks+0x5c/0x7b
    [&lt;c0199724&gt;] lock_acquire+0x66/0xb9
    [&lt;c02277d4&gt;] ? writeback_inodes_sb_if_idle+0x28/0x46
    [&lt;c06db935&gt;] down_read+0x28/0x58
    [&lt;c02277d4&gt;] ? writeback_inodes_sb_if_idle+0x28/0x46
    [&lt;c02277d4&gt;] writeback_inodes_sb_if_idle+0x28/0x46
    [&lt;c026f3b2&gt;] ext4_nonda_switch+0xe1/0xf4
    [&lt;c0271ece&gt;] ext4_da_write_begin+0x27/0x193
    [&lt;c01dcdb0&gt;] generic_file_buffered_write+0xc8/0x1bb
    [&lt;c01ddc47&gt;] __generic_file_aio_write+0x1dd/0x205
    [&lt;c01ddce7&gt;] generic_file_aio_write+0x78/0xd3
    [&lt;c026d336&gt;] ext4_file_write+0x480/0x4a6
    [&lt;c0198c1d&gt;] ? __lock_acquire+0x41e/0xb6c
    [&lt;c0180944&gt;] ? sched_clock_cpu+0x11a/0x13e
    [&lt;c01967e9&gt;] ? trace_hardirqs_off+0xb/0xd
    [&lt;c018099f&gt;] ? local_clock+0x37/0x4e
    [&lt;c0209f2c&gt;] do_sync_write+0x67/0x9d
    [&lt;c0209ec5&gt;] ? wait_on_retry_sync_kiocb+0x44/0x44
    [&lt;c020a7b9&gt;] vfs_write+0x7b/0xe6
    [&lt;c020a9a6&gt;] sys_write+0x3b/0x64
    [&lt;c06dd4bd&gt;] syscall_call+0x7/0xb

Signed-off-by: "Theodore Ts'o" &lt;tytso@mit.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>Merge tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux</title>
<updated>2012-03-28T17:07:27Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-28T17:07:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=529b73fc0a9764050dcc597f4851728e8ff59165'/>
<id>urn:sha1:529b73fc0a9764050dcc597f4851728e8ff59165</id>
<content type='text'>
Pull trivial writeback fixes from Wu Fengguang:
 "They've been tested in linux-next for 20 days actually."

* tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: Remove outdated comment
  fs: Remove bogus wait in write_inode_now()
</content>
</entry>
<entry>
<title>Merge tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux</title>
<updated>2012-03-24T17:24:31Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-24T17:24:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=11bcb32848ddb5ab28f09f142b625e2ba4d55c4c'/>
<id>urn:sha1:11bcb32848ddb5ab28f09f142b625e2ba4d55c4c</id>
<content type='text'>
Pull cleanup of fs/ and lib/ users of module.h from Paul Gortmaker:
 "Fix up files in fs/ and lib/ dirs to only use module.h if they really
  need it.

  These are trivial in scope vs the work done previously.  We now have
  things where any few remaining cleanups can be farmed out to arch or
  subsystem maintainers, and I have done so when possible.  What is
  remaining here represents the bits that don't clearly lie within a
  single arch/subsystem boundary, like the fs dir and the lib dir.

  Some duplicate includes arising from overlapping fixes from
  independent subsystem maintainer submissions are also quashed."

Fix up trivial conflicts due to clashes with other include file cleanups
(including some due to the previous bug.h cleanup pull).

* tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  lib: reduce the use of module.h wherever possible
  fs: reduce the use of module.h wherever possible
  includecheck: delete any duplicate instances of module.h
</content>
</entry>
<entry>
<title>writeback: Remove outdated comment</title>
<updated>2012-03-21T07:27:08Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-03-09T15:26:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=697e6fed9fc620eb6c79ebcfe6865b66773c0221'/>
<id>urn:sha1:697e6fed9fc620eb6c79ebcfe6865b66773c0221</id>
<content type='text'>
The comment is hopelessly outdated and misplaced. We no longer have 'bdi'
part of writeback work, the comment about blockdev super is outdated,
comment about throttling as well. Information about list handling is in
more detail at queue_io(). So just move the bit about older_than_this to
close to move_expired_inodes() and remove the rest.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>fs: Remove bogus wait in write_inode_now()</title>
<updated>2012-03-21T07:26:47Z</updated>
<author>
<name>Jan Kara</name>
<email>jack@suse.cz</email>
</author>
<published>2012-03-09T15:26:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f469ec9c5b95dfed60d5d628e1a8cecfc1f92d7a'/>
<id>urn:sha1:f469ec9c5b95dfed60d5d628e1a8cecfc1f92d7a</id>
<content type='text'>
inode_sync_wait() in write_inode_now() is just bogus. That function waits for
I_SYNC bit to be cleared but writeback_single_inode() clears the bit on return
so the wait is effectivelly a nop unless someone else submits the inode for
writeback again. All the waiting write_inode_now() needs is achieved by using
WB_SYNC_ALL writeback mode.

Signed-off-by: Jan Kara &lt;jack@suse.cz&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial</title>
<updated>2012-03-21T04:12:50Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-03-21T04:12:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=69a7aebcf019ab3ff5764525ad6858fbe23bb86d'/>
<id>urn:sha1:69a7aebcf019ab3ff5764525ad6858fbe23bb86d</id>
<content type='text'>
Pull trivial tree from Jiri Kosina:
 "It's indeed trivial -- mostly documentation updates and a bunch of
  typo fixes from Masanari.

  There are also several linux/version.h include removals from Jesper."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (101 commits)
  kcore: fix spelling in read_kcore() comment
  constify struct pci_dev * in obvious cases
  Revert "char: Fix typo in viotape.c"
  init: fix wording error in mm_init comment
  usb: gadget: Kconfig: fix typo for 'different'
  Revert "power, max8998: Include linux/module.h just once in drivers/power/max8998_charger.c"
  writeback: fix fn name in writeback_inodes_sb_nr_if_idle() comment header
  writeback: fix typo in the writeback_control comment
  Documentation: Fix multiple typo in Documentation
  tpm_tis: fix tis_lock with respect to RCU
  Revert "media: Fix typo in mixer_drv.c and hdmi_drv.c"
  Doc: Update numastat.txt
  qla4xxx: Add missing spaces to error messages
  compiler.h: Fix typo
  security: struct security_operations kerneldoc fix
  Documentation: broken URL in libata.tmpl
  Documentation: broken URL in filesystems.tmpl
  mtd: simplify return logic in do_map_probe()
  mm: fix comment typo of truncate_inode_pages_range
  power: bq27x00: Fix typos in comment
  ...
</content>
</entry>
<entry>
<title>writeback: fix fn name in writeback_inodes_sb_nr_if_idle() comment header</title>
<updated>2012-03-07T15:08:46Z</updated>
<author>
<name>Fengguang Wu</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-03-05T23:08:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c097b2ca5140249abc3fb5ae9a545c35125ae8d0'/>
<id>urn:sha1:c097b2ca5140249abc3fb5ae9a545c35125ae8d0</id>
<content type='text'>
Signed-off-by: Fengguang Wu &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>fs: reduce the use of module.h wherever possible</title>
<updated>2012-02-29T00:31:58Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-11-17T04:57:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=630d9c47274aa89bfa77fe6556d7818bdcb12992'/>
<id>urn:sha1:630d9c47274aa89bfa77fe6556d7818bdcb12992</id>
<content type='text'>
For files only using THIS_MODULE and/or EXPORT_SYMBOL, map
them onto including export.h -- or if the file isn't even
using those, then just delete the include.  Fix up any implicit
include dependencies that were being masked by module.h along
the way.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>writeback: fix NULL bdi-&gt;dev in trace writeback_single_inode</title>
<updated>2012-02-01T08:53:40Z</updated>
<author>
<name>Wu Fengguang</name>
<email>fengguang.wu@intel.com</email>
</author>
<published>2012-01-17T17:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=15eb77a07c714ac80201abd0a9568888bcee6276'/>
<id>urn:sha1:15eb77a07c714ac80201abd0a9568888bcee6276</id>
<content type='text'>
bdi_prune_sb() resets sb-&gt;s_bdi to default_backing_dev_info when the
tearing down the original bdi. Fix trace_writeback_single_inode to
use sb-&gt;s_bdi=default_backing_dev_info rather than bdi-&gt;dev=NULL for a
teared down bdi.

Cc: &lt;stable@kernel.org&gt;
Reported-by: Rabin Vincent &lt;rabin@rab.in&gt;
Tested-by: Rabin Vincent &lt;rabin@rab.in&gt;
Signed-off-by: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux</title>
<updated>2012-01-11T00:59:59Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-01-11T00:59:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=001a541ea9163ace5e8243ee0e907ad80a4c0ec2'/>
<id>urn:sha1:001a541ea9163ace5e8243ee0e907ad80a4c0ec2</id>
<content type='text'>
* 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: move MIN_WRITEBACK_PAGES to fs-writeback.c
  writeback: balanced_rate cannot exceed write bandwidth
  writeback: do strict bdi dirty_exceeded
  writeback: avoid tiny dirty poll intervals
  writeback: max, min and target dirty pause time
  writeback: dirty ratelimit - think time compensation
  btrfs: fix dirtied pages accounting on sub-page writes
  writeback: fix dirtied pages accounting on redirty
  writeback: fix dirtied pages accounting on sub-page writes
  writeback: charge leaked page dirties to active tasks
  writeback: Include all dirty inodes in background writeback
</content>
</entry>
</feed>
