)]}'
{
  "log": [
    {
      "commit": "6268b325c3066234e7bddb99d2b98bcedb0c0033",
      "tree": "5dca66fae30aa44e314ec6713ab31b773ad788e4",
      "parents": [
        "12679a2d7e3bfbdc7586e3e86d1ca90c46659363"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Mar 29 17:00:56 2012 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Thu Mar 29 17:00:56 2012 -0700"
      },
      "message": "Revert \"ext4: don\u0027t release page refs in ext4_end_bio()\"\n\nThis reverts commit b43d17f319f2c502b17139d1cf70731b2b62c644.\n\nDave Jones reports that it causes lockups on his laptop, and his debug\noutput showed a lot of processes hung waiting for page_writeback (or\nmore commonly - processes hung waiting for a lock that was held during\nthat writeback wait).\n\nThe page_writeback hint made Ted suggest that Dave look at this commit,\nand Dave verified that reverting it makes his problems go away.\n\nTed says:\n \"That commit fixes a race which is seen when you write into fallocated\n  (and hence uninitialized) disk blocks under *very* heavy memory\n  pressure.  Furthermore, although theoretically it could trigger under\n  normal direct I/O writes, it only seems to trigger if you are issuing\n  a huge number of AIO writes, such that a just-written page can get\n  evicted from memory, and then read back into memory, before the\n  workqueue has a chance to update the extent tree.\n\n  This race has been around for a little over a year, and no one noticed\n  until two months ago; it only happens under fairly exotic conditions,\n  and in fact even after trying very hard to create a simple repro under\n  lab conditions, we could only reproduce the problem and confirm the\n  fix on production servers running MySQL on very fast PCIe-attached\n  flash devices.\n\n  Given that Dave was able to hit this problem pretty quickly, if we\n  confirm that this commit is at fault, the only reasonable thing to do\n  is to revert it IMO.\"\n\nReported-and-tested-by: Dave Jones \u003cdavej@redhat.com\u003e\nAcked-by: Theodore Ts\u0027o \u003ctytso@mit.edu\u003e\nSigned-off-by: Linus Torvalds \u003ctorvalds@linux-foundation.org\u003e\n"
    },
    {
      "commit": "b43d17f319f2c502b17139d1cf70731b2b62c644",
      "tree": "05215b2155e4dbc66f6b1035b8afba7c805284db",
      "parents": [
        "491caa43639abcffaa645fbab372a7ef4ce2975c"
      ],
      "author": {
        "name": "Curt Wohlgemuth",
        "email": "curtw@google.com",
        "time": "Mon Mar 05 10:40:15 2012 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Mar 05 10:40:15 2012 -0500"
      },
      "message": "ext4: don\u0027t release page refs in ext4_end_bio()\n\nWe can clear PageWriteback on each page when the IO\ncompletes, but we can\u0027t release the references on the page\nuntil we convert any uninitialized extents.\n\nWithout this patch, the use of the dioread_nolock mount\noption can break buffered writes, because extents may\nnot be converted by the time a subsequent buffered read\ncomes in; if the page is not in the page cache, a read\nwill return zeros if the extent is still uninitialized.\n\nI tested this with a (temporary) patch that adds a call\nto msleep(1000) at the start of ext4_end_io_work(), to delay\nprocessing of each DIO-unwritten work queue item.  With this\nmsleep(), a simple workload of\n\n  fallocate\n  write\n  fadvise\n  read\n\nwill fail without this patch, succeeds with it.\n\nSigned-off-by: Curt Wohlgemuth \u003ccurtw@google.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "491caa43639abcffaa645fbab372a7ef4ce2975c",
      "tree": "361ce8690a50681765a21fb6c0ed579034ae4b4e",
      "parents": [
        "93ef8541d5c3ad1a73057ff358a49d0ee7146d6f"
      ],
      "author": {
        "name": "Jeff Moyer",
        "email": "jmoyer@redhat.com",
        "time": "Mon Mar 05 10:29:52 2012 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Mar 05 10:29:52 2012 -0500"
      },
      "message": "ext4: fix race between sync and completed io work\n\nThe following command line will leave the aio-stress process unkillable\non an ext4 file system (in my case, mounted on /mnt/test):\n\naio-stress -t 20 -s 10 -O -S -o 2 -I 1000 /mnt/test/aiostress.3561.4 /mnt/test/aiostress.3561.4.20 /mnt/test/aiostress.3561.4.19 /mnt/test/aiostress.3561.4.18 /mnt/test/aiostress.3561.4.17 /mnt/test/aiostress.3561.4.16 /mnt/test/aiostress.3561.4.15 /mnt/test/aiostress.3561.4.14 /mnt/test/aiostress.3561.4.13 /mnt/test/aiostress.3561.4.12 /mnt/test/aiostress.3561.4.11 /mnt/test/aiostress.3561.4.10 /mnt/test/aiostress.3561.4.9 /mnt/test/aiostress.3561.4.8 /mnt/test/aiostress.3561.4.7 /mnt/test/aiostress.3561.4.6 /mnt/test/aiostress.3561.4.5 /mnt/test/aiostress.3561.4.4 /mnt/test/aiostress.3561.4.3 /mnt/test/aiostress.3561.4.2\n\nThis is using the aio-stress program from the xfstests test suite.\nThat particular command line tells aio-stress to do random writes to\n20 files from 20 threads (one thread per file).  The files are NOT\npreallocated, so you will get writes to random offsets within the\nfile, thus creating holes and extending i_size.  It also opens the\nfile with O_DIRECT and O_SYNC.\n\nOn to the problem.  When an I/O requires unwritten extent conversion,\nit is queued onto the completed_io_list for the ext4 inode.  Two code\npaths will pull work items from this list.  The first is the\next4_end_io_work routine, and the second is ext4_flush_completed_IO,\nwhich is called via the fsync path (and O_SYNC handling, as well).\nThere are two issues I\u0027ve found in these code paths.  First, if the\nfsync path beats the work routine to a particular I/O, the work\nroutine will free the io_end structure!  It does not take into account\nthe fact that the io_end may still be in use by the fsync path.  I\u0027ve\nfixed this issue by adding yet another IO_END flag, indicating that\nthe io_end is being processed by the fsync path.\n\nThe second problem is that the work routine will make an assignment to\nio-\u003eflag outside of the lock.  I have witnessed this result in a hang\nat umount.  Moving the flag setting inside the lock resolved that\nproblem.\n\nThe problem was introduced by commit b82e384c7b (\"ext4: optimize\nlocking for end_io extent conversion\"), which first appeared in 3.2.\nAs such, the fix should be backported to that release (probably along\nwith the unwritten extent conversion race fix).\n\nSigned-off-by: Jeff Moyer \u003cjmoyer@redhat.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCC: stable@kernel.org\n\n"
    },
    {
      "commit": "266991b13890049ee1a6bb95b9817f06339ee3d7",
      "tree": "55c4f0e3c0b978e563ced079002bcf7ea60d9767",
      "parents": [
        "d4dc462f556afe510d58d3b12b3d66c2cabff539"
      ],
      "author": {
        "name": "Jeff Moyer",
        "email": "jmoyer@redhat.com",
        "time": "Mon Feb 20 17:59:24 2012 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Feb 20 17:59:24 2012 -0500"
      },
      "message": "ext4: fix race between unwritten extent conversion and truncate\n\nThe following comment in ext4_end_io_dio caught my attention:\n\n\t/* XXX: probably should move into the real I/O completion handler */\n        inode_dio_done(inode);\n\nThe truncate code takes i_mutex, then calls inode_dio_wait.  Because the\next4 code path above will end up dropping the mutex before it is\nreacquired by the worker thread that does the extent conversion, it\nseems to me that the truncate can happen out of order.  Jan Kara\nmentioned that this might result in error messages in the system logs,\nbut that should be the extent of the \"damage.\"\n\nThe fix is pretty straight-forward: don\u0027t call inode_dio_done until the\nextent conversion is complete.\n\nReviewed-by: Jan Kara \u003cjack@suse.cz\u003e\nSigned-off-by: Jeff Moyer \u003cjmoyer@redhat.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCc: stable@vger.kernel.org\n"
    },
    {
      "commit": "ac69e0928054ff29a5049902fb477f9c7605c773",
      "tree": "05be6b9285186823452e0adeffe40e1dfee6e354",
      "parents": [
        "9e203936eac786f9268d6a13e6442d2accef1829",
        "302bf2f3259948c93361d501b04a5ed69c3bd4f8"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Jan 09 12:51:21 2012 -0800"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Mon Jan 09 12:51:21 2012 -0800"
      },
      "message": "Merge branch \u0027for_linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs\n\n* \u0027for_linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:\n  ext2/3/4: delete unneeded includes of module.h\n  ext{3,4}: Fix potential race when setversion ioctl updates inode\n  udf: Mark LVID buffer as uptodate before marking it dirty\n  ext3: Don\u0027t warn from writepage when readonly inode is spotted after error\n  jbd: Remove j_barrier mutex\n  reiserfs: Force inode evictions before umount to avoid crash\n  reiserfs: Fix quota mount option parsing\n  udf: Treat symlink component of type 2 as /\n  udf: Fix deadlock when converting file from in-ICB one to normal one\n  udf: Cleanup calling convention of inode_getblk()\n  ext2: Fix error handling on inode bitmap corruption\n  ext3: Fix error handling on inode bitmap corruption\n  ext3: replace ll_rw_block with other functions\n  ext3: NULL dereference in ext3_evict_inode()\n  jbd: clear revoked flag on buffers before a new transaction started\n  ext3: call ext3_mark_recovery_complete() when recovery is really needed\n"
    },
    {
      "commit": "302bf2f3259948c93361d501b04a5ed69c3bd4f8",
      "tree": "22ccdf5774a28476745a94532b5ce2c2cc454d98",
      "parents": [
        "6c2155b9cc5a193e85194bbeaae2e2e4512dd597"
      ],
      "author": {
        "name": "Paul Gortmaker",
        "email": "paul.gortmaker@windriver.com",
        "time": "Wed Jan 04 15:59:47 2012 -0500"
      },
      "committer": {
        "name": "Jan Kara",
        "email": "jack@suse.cz",
        "time": "Mon Jan 09 13:52:10 2012 +0100"
      },
      "message": "ext2/3/4: delete unneeded includes of module.h\n\nDelete any instances of include module.h that were not strictly\nrequired.  In the case of ext2, the declaration of MODULE_LICENSE\netc. were in inode.c but the module_init/exit were in super.c, so\nrelocate the MODULE_LICENCE/AUTHOR block to super.c which makes it\nconsistent with ext3 and ext4 at the same time.\n\nSigned-off-by: Paul Gortmaker \u003cpaul.gortmaker@windriver.com\u003e\nSigned-off-by: Jan Kara \u003cjack@suse.cz\u003e\n"
    },
    {
      "commit": "5a0dc7365c240795bf190766eba7a27600be3b3e",
      "tree": "614d5275640f4df89604f64e2cd47a438644226e",
      "parents": [
        "5b5ffa49d4bbb8ca4c41c094261660264f16bd20"
      ],
      "author": {
        "name": "Yongqiang Yang",
        "email": "xiaoqiangnk@gmail.com",
        "time": "Tue Dec 13 22:29:12 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Tue Dec 13 22:29:12 2011 -0500"
      },
      "message": "ext4: handle EOF correctly in ext4_bio_write_page()\n\nWe need to zero out part of a page which beyond EOF before setting uptodate,\notherwise, mapread or write will see non-zero data beyond EOF.\n\nSigned-off-by: Yongqiang Yang \u003cxiaoqiangnk@gmail.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCc: stable@kernel.org\n"
    },
    {
      "commit": "0edeb71dc9133bfb505d3bf59642e07cd936613e",
      "tree": "bcb68e2676d9bba1e4e4e28fb1ba8d382caf26eb",
      "parents": [
        "b82e384c7bb9a19036b4daf58fa216df7cd48aa0"
      ],
      "author": {
        "name": "Tao Ma",
        "email": "boyu.mt@taobao.com",
        "time": "Mon Oct 31 17:30:44 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Oct 31 17:30:44 2011 -0400"
      },
      "message": "ext4: Create helper function for EXT4_IO_END_UNWRITTEN and i_aiodio_unwritten\n\nEXT4_IO_END_UNWRITTEN flag set and the increase of i_aiodio_unwritten\nshould be done simultaneously since ext4_end_io_nolock always clear\nthe flag and decrease the counter in the same time.\n\nWe have found some bugs that the flag is set while leaving\ni_aiodio_unwritten unchanged(commit 32c80b32c053d). So this patch just tries\nto create a helper function to wrap them to avoid any future bug.\nThe idea is inspired by Eric.\n\nCc: Eric Sandeen \u003csandeen@redhat.com\u003e\nSigned-off-by: Tao Ma \u003cboyu.mt@taobao.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "b82e384c7bb9a19036b4daf58fa216df7cd48aa0",
      "tree": "42bde122000b3bf3adf7eaa0328e0fdafdb3b5fd",
      "parents": [
        "4e298021216727cc27017c5032ade86167c66256"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Oct 31 10:56:32 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Oct 31 10:56:32 2011 -0400"
      },
      "message": "ext4: optimize locking for end_io extent conversion\n\nNow that we are doing the locking correctly, we need to grab the\ni_completed_io_lock() twice per end_io.  We can clean this up by\nremoving the structure from the i_complted_io_list, and use this as\nthe locking mechanism to prevent ext4_flush_completed_IO() racing\nagainst ext4_end_io_work(), instead of clearing the\nEXT4_IO_END_UNWRITTEN in io-\u003eflag.\n\nIn addition, if the ext4_convert_unwritten_extents() returns an error,\nwe no longer keep the end_io structure on the linked list.  This\ndoesn\u0027t help, because it tends to lock up the file system and wedges\nthe system.  That\u0027s one way to call attention to the problem, but it\ndoesn\u0027t help the overall robustness of the system.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "4e298021216727cc27017c5032ade86167c66256",
      "tree": "e50ab2e0747252c200773fc3e2a5bd885f85a30c",
      "parents": [
        "d73d5046a72467d4510825b99e2269e09ad80e15"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Oct 30 18:41:19 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Oct 30 18:41:19 2011 -0400"
      },
      "message": "ext4: remove unnecessary call to waitqueue_active()\n\nThe usage of waitqueue_active() is not necessary, and introduces (I\nbelieve) a hard-to-hit race.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "d73d5046a72467d4510825b99e2269e09ad80e15",
      "tree": "4ac8b5729e1aeffe8348557a7f77da1791c268cc",
      "parents": [
        "6d6a435190bdf2e04c9465cde5bdc3ac68cf11a4"
      ],
      "author": {
        "name": "Tao Ma",
        "email": "boyu.mt@taobao.com",
        "time": "Sun Oct 30 18:26:08 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Oct 30 18:26:08 2011 -0400"
      },
      "message": "ext4: Use correct locking for ext4_end_io_nolock()\n\nWe must hold i_completed_io_lock when manipulating anything on the\ni_completed_io_list linked list.  This includes io-\u003elock, which we\nwere checking in ext4_end_io_nolock().\n\nSo move this check to ext4_end_io_work().  This also has the bonus of\navoiding extra work if it is already done without needing to take the\nmutex.\n\nSigned-off-by: Tao Ma \u003cboyu.mt@taobao.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "8c0bec2151a47906bf779c6715a10ce04453ab77",
      "tree": "0165e80ba408b5db1e9e2adf9264bf4186b06768",
      "parents": [
        "fcb8ce5cfe30ca9ca5c9a79cdfe26d1993e65e0c"
      ],
      "author": {
        "name": "Jiaying Zhang",
        "email": "jiayingz@google.com",
        "time": "Wed Aug 31 11:50:51 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Aug 31 11:50:51 2011 -0400"
      },
      "message": "ext4: remove i_mutex lock in ext4_evict_inode to fix lockdep complaining\n\nThe i_mutex lock and flush_completed_IO() added by commit 2581fdc810\nin ext4_evict_inode() causes lockdep complaining about potential\ndeadlock in several places.  In most/all of these LOCKDEP complaints\nit looks like it\u0027s a false positive, since many of the potential\ncircular locking cases can\u0027t take place by the time the\next4_evict_inode() is called; but since at the very least it may mask\nreal problems, we need to address this.\n\nThis change removes the flush_completed_IO() and i_mutex lock in\next4_evict_inode().  Instead, we take a different approach to resolve\nthe software lockup that commit 2581fdc810 intends to fix.  Rather\nthan having ext4-dio-unwritten thread wait for grabing the i_mutex\nlock of an inode, we use mutex_trylock() instead, and simply requeue\nthe work item if we fail to grab the inode\u0027s i_mutex lock.\n\nThis should speed up work queue processing in general and also\nprevents the following deadlock scenario: During page fault,\nshrink_icache_memory is called that in turn evicts another inode B.\nInode B has some pending io_end work so it calls ext4_ioend_wait()\nthat waits for inode B\u0027s i_ioend_count to become zero.  However, inode\nB\u0027s ioend work was queued behind some of inode A\u0027s ioend work on the\nsame cpu\u0027s ext4-dio-unwritten workqueue.  As the ext4-dio-unwritten\nthread on that cpu is processing inode A\u0027s ioend work, it tries to\ngrab inode A\u0027s i_mutex lock.  Since the i_mutex lock of inode A is\nstill hold before the page fault happened, we enter a deadlock.\n\nSigned-off-by: Jiaying Zhang \u003cjiayingz@google.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "32c80b32c053dc52712dedac5e4d0aa7c93fc353",
      "tree": "857375faae2d6c562741d14ed13a1411b197baf5",
      "parents": [
        "2581fdc810889fdea97689cb62481201d579c796"
      ],
      "author": {
        "name": "Tao Ma",
        "email": "boyu.mt@taobao.com",
        "time": "Sat Aug 13 12:30:59 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sat Aug 13 12:30:59 2011 -0400"
      },
      "message": "ext4: Resolve the hang of direct i/o read in handling EXT4_IO_END_UNWRITTEN.\n\nEXT4_IO_END_UNWRITTEN flag set and the increase of i_aiodio_unwritten\nshould be done simultaneously since ext4_end_io_nolock always clear\nthe flag and decrease the counter in the same time.\n\nWe don\u0027t increase i_aiodio_unwritten when setting\nEXT4_IO_END_UNWRITTEN so it will go nagative and causes some process\nto wait forever.\n\nPart of the patch came from Eric in his e-mail, but it doesn\u0027t fix the\nproblem met by Michael actually.\n\nhttp://marc.info/?l\u003dlinux-ext4\u0026m\u003d131316851417460\u0026w\u003d2\n\nReported-and-Tested-by: Michael Tokarev\u003cmjt@tls.msk.ru\u003e\nSigned-off-by: Eric Sandeen \u003csandeen@redhat.com\u003e\nSigned-off-by: Tao Ma \u003cboyu.mt@taobao.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCc: stable@kernel.org\n"
    },
    {
      "commit": "275d3ba6b40d0f098693b9089c6fee9bd4e55d74",
      "tree": "0f78d9bc4fe10424a692370655d27ee6f509a470",
      "parents": [
        "9331b6261058eb85ae7c57ab8ac279e7fdaa9f04"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Jun 29 21:44:45 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Jun 29 21:44:45 2011 -0400"
      },
      "message": "ext4: remove loop around bio_alloc()\n\nThese days, bio_alloc() is guaranteed to never fail (as long as nvecs\nis less than BIO_MAX_PAGES), so we don\u0027t need the loop around the\nstruct bio allocation.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "39db00f1c45e770856264bdb3ceca27980b01965",
      "tree": "a06fcf532d9bbb06395016a653840efa7436c6bf",
      "parents": [
        "2035e776050aea57fb5255557216473e82793f2c"
      ],
      "author": {
        "name": "Curt Wohlgemuth",
        "email": "curtw@google.com",
        "time": "Sat Apr 30 13:26:26 2011 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sat Apr 30 13:26:26 2011 -0400"
      },
      "message": "ext4: don\u0027t set PageUptodate in ext4_end_bio()\n\nIn the bio completion routine, we should not be setting\nPageUptodate at all -- it\u0027s set at sys_write() time, and is\nunaffected by success/failure of the write to disk.\n\nThis can cause a page corruption bug when the file system\u0027s\nblock size is less than the architecture\u0027s VM page size.\n\nif we have only written a single block -- we might end up\nsetting the page\u0027s PageUptodate flag, indicating that page\nis completely read into memory, which may not be true.\nThis could cause subsequent reads to get bad data.\n\nThis commit also takes the opportunity to clean up error\nhandling in ext4_end_bio(), and remove some extraneous code:\n\n   - fixes ext4_end_bio() to set AS_EIO in the\n     page-\u003emapping-\u003eflags on error, which was left out by\n     mistake.  This is needed so that fsync() will\n     return an error if there was an I/O error.\n   - remove the clear_buffer_dirty() call on unmapped\n     buffers for each page.\n   - consolidate page/buffer error handling in a single\n     section.\n\nSigned-off-by: Curt Wohlgemuth \u003ccurtw@google.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nReported-by: Jim Meyering \u003cjim@meyering.net\u003e\nReported-by: Hugh Dickins \u003chughd@google.com\u003e\nCc: Mingming Cao \u003ccmm@us.ibm.com\u003e\n"
    },
    {
      "commit": "ae005cbed12d0b340b04b59d6f5c56e710b3895d",
      "tree": "d464865bcc97bea05eab4eba0d10bcad4ec89b93",
      "parents": [
        "3961cdf85b749f6bab50ad31ee97e9277e7a3b70",
        "0ba0851714beebb800992e5105a79dc3a4c504b0"
      ],
      "author": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri Mar 25 09:57:40 2011 -0700"
      },
      "committer": {
        "name": "Linus Torvalds",
        "email": "torvalds@linux-foundation.org",
        "time": "Fri Mar 25 09:57:41 2011 -0700"
      },
      "message": "Merge branch \u0027for_linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4\n\n* \u0027for_linus\u0027 of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (43 commits)\n  ext4: fix a BUG in mb_mark_used during trim.\n  ext4: unused variables cleanup in fs/ext4/extents.c\n  ext4: remove redundant set_buffer_mapped() in ext4_da_get_block_prep()\n  ext4: add more tracepoints and use dev_t in the trace buffer\n  ext4: don\u0027t kfree uninitialized s_group_info members\n  ext4: add missing space in printk\u0027s in __ext4_grp_locked_error()\n  ext4: add FITRIM to compat_ioctl.\n  ext4: handle errors in ext4_clear_blocks()\n  ext4: unify the ext4_handle_release_buffer() api\n  ext4: handle errors in ext4_rename\n  jbd2: add COW fields to struct jbd2_journal_handle\n  jbd2: add the b_cow_tid field to journal_head struct\n  ext4: Initialize fsync transaction ids in ext4_new_inode()\n  ext4: Use single thread to perform DIO unwritten convertion\n  ext4: optimize ext4_bio_write_page() when no extent conversion is needed\n  ext4: skip orphan cleanup if fs has unknown ROCOMPAT features\n  ext4: use the nblocks arg to ext4_truncate_restart_trans()\n  ext4: fix missing iput of root inode for some mount error paths\n  ext4: make FIEMAP and delayed allocation play well together\n  ext4: suppress verbose debugging information if malloc-debug is off\n  ...\n\nFi up conflicts in fs/ext4/super.c due to workqueue changes\n"
    },
    {
      "commit": "721a9602e6607417c6bc15b18e97a2f35266c690",
      "tree": "4987991e43f35b8b3b685fea0040c5265b578996",
      "parents": [
        "cf15900e1209d5b46ec2d24643adbf561830935f"
      ],
      "author": {
        "name": "Jens Axboe",
        "email": "jaxboe@fusionio.com",
        "time": "Wed Mar 09 11:56:30 2011 +0100"
      },
      "committer": {
        "name": "Jens Axboe",
        "email": "jaxboe@fusionio.com",
        "time": "Thu Mar 10 08:52:27 2011 +0100"
      },
      "message": "block: kill off REQ_UNPLUG\n\nWith the plugging now being explicitly controlled by the\nsubmitter, callers need not pass down unplugging hints\nto the block layer. If they want to unplug, it\u0027s because they\nmanually plugged on their own - in which case, they should just\nunplug at will.\n\nSigned-off-by: Jens Axboe \u003cjaxboe@fusionio.com\u003e\n"
    },
    {
      "commit": "b616844310a6c8a4ab405d3436bbb6e53cfd852f",
      "tree": "7fff51c3d55b21df27d93382c8bd0f2910f83263",
      "parents": [
        "d39195c33bb1b5fdcb0f416e8a0b34bfdb07a027"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Feb 28 13:12:38 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Feb 28 13:12:38 2011 -0500"
      },
      "message": "ext4: optimize ext4_bio_write_page() when no extent conversion is needed\n\nIf no extent conversion is required, wake up any processes waiting for\nthe page\u0027s writeback to be complete and free the ext4_io_end structure\ndirectly in ext4_end_bio() instead of dropping it on the linked list\n(which requires taking a spinlock to queue and dequeue the io_end\nstructure), and waiting for the workqueue to do this work.\n\nThis removes an extra scheduling delay before process waiting for an\nfsync() to complete gets woken up, and it also reduces the CPU\noverhead for a random write workload.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "a54aa76108619e5d8290b49081c2aaaeff5be9a2",
      "tree": "a3c436e29b5452f9c17bffc7bbc6b8f437c3255c",
      "parents": [
        "168fc0223c0e944957b1f31d88c2334fc904baf1"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Feb 27 16:43:24 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Feb 27 16:43:24 2011 -0500"
      },
      "message": "ext4: don\u0027t leave PageWriteback set after memory failure\n\nIn ext4_bio_write_page(), if the memory allocation for the struct\next4_io_page fails, it returns with the page\u0027s PageWriteback flag set.\nThis will end up causing the page not to skip writeback in\nWB_SYNC_NONE mode, and in WB_SYNC_ALL mode (i.e., on a sync, fsync, or\numount) the writeback daemon will get stuck forever on the\nwait_on_page_writeback() function in write_cache_pages_da().\n\nOr, if journalling is enabled and the file gets deleted, it the\njournal thread can get stuck in journal_finish_inode_data_buffers()\ncall to filemap_fdatawait().\n\nAnother place where things can get hung up is in\ntruncate_inode_pages(), called out of ext4_evict_inode().\n\nFix this by not setting PageWriteback until after we have successfully\nallocated the struct ext4_io_page.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "7dc576158d7e5cdff3349f78598fdb4080536342",
      "tree": "e7be15a8ee8add729915c81e9cb39cd55d6b572d",
      "parents": [
        "da488945f4bf4096f4ab6091938469bd8822cfec"
      ],
      "author": {
        "name": "Peter Huewe",
        "email": "peterhuewe@gmx.de",
        "time": "Mon Feb 21 21:01:42 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Feb 21 21:01:42 2011 -0500"
      },
      "message": "ext4: Fix sparse warning: Using plain integer as NULL pointer\n\nThis patch fixes the warning \"Using plain integer as NULL pointer\",\ngenerated by sparse, by replacing the offending 0s with NULL.\n\nSigned-off-by: Peter Huewe \u003cpeterhuewe@gmx.de\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "e9e3bcecf44c04b9e6b505fd8e2eb9cea58fb94d",
      "tree": "9f347a48889a00071dbe1f12be4c50ec7a45542b",
      "parents": [
        "2892c15ddda6a76dc10b7499e56c0f3b892e5a69"
      ],
      "author": {
        "name": "Eric Sandeen",
        "email": "sandeen@redhat.com",
        "time": "Sat Feb 12 08:17:34 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sat Feb 12 08:17:34 2011 -0500"
      },
      "message": "ext4: serialize unaligned asynchronous DIO\n\next4 has a data corruption case when doing non-block-aligned\nasynchronous direct IO into a sparse file, as demonstrated\nby xfstest 240.\n\nThe root cause is that while ext4 preallocates space in the\nhole, mappings of that space still look \"new\" and \ndio_zero_block() will zero out the unwritten portions.  When\nmore than one AIO thread is going, they both find this \"new\"\nblock and race to zero out their portion; this is uncoordinated\nand causes data corruption.\n\nDave Chinner fixed this for xfs by simply serializing all\nunaligned asynchronous direct IO.  I\u0027ve done the same here.\nThe difference is that we only wait on conversions, not all IO.\nThis is a very big hammer, and I\u0027m not very pleased with\nstuffing this into ext4_file_write().  But since ext4 is\nDIO_LOCKING, we need to serialize it at this high level.\n\nI tried to move this into ext4_ext_direct_IO, but by then\nwe have the i_mutex already, and we will wait on the\nwork queue to do conversions - which must also take the\ni_mutex.  So that won\u0027t work.\n\nThis was originally exposed by qemu-kvm installing to\na raw disk image with a normal sector-63 alignment.  I\u0027ve\ntested a backport of this patch with qemu, and it does\navoid the corruption.  It is also quite a lot slower\n(14 min for package installs, vs. 8 min for well-aligned)\nbut I\u0027ll take slow correctness over fast corruption any day.\n\nMingming suggested that we can track outstanding\nconversions, and wait on those so that non-sparse\nfiles won\u0027t be affected, and I\u0027ve implemented that here;\nunaligned AIO to nonsparse files won\u0027t take a perf hit.\n\n[tytso@mit.edu: Keep the mutex as a hashed array instead\n of bloating the ext4 inode]\n\n[tytso@mit.edu: Fix up namespace issues so that global\n variables are protected with an \"ext4_\" prefix.]\n\nSigned-off-by: Eric Sandeen \u003csandeen@redhat.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "d50bdd5aa55127635fd8a5c74bd2abb256bd34e3",
      "tree": "3dbe0f5d06502e144c0398c71e8fe479a855d6f4",
      "parents": [
        "dd68314ccf3fb918c1fb6471817edbc60ece4b52"
      ],
      "author": {
        "name": "Curt Wohlgemuth",
        "email": "curtw@google.com",
        "time": "Mon Feb 07 12:46:14 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Feb 07 12:46:14 2011 -0500"
      },
      "message": "ext4: Fix data corruption with multi-block writepages support\n\nThis fixes a corruption problem with the multi-block\nwritepages submittal change for ext4, from commit\nbd2d0210cf22f2bd0cef72eb97cf94fc7d31d8cc (\"ext4: use bio\nlayer instead of buffer layer in mpage_da_submit_io\").\n\n(Note that this corruption is not present in 2.6.37 on\next4, because the corruption was detected after the\nfeature was merged in 2.6.37-rc1, and so it was turned\noff by adding a non-default mount option,\nmblk_io_submit.  With this commit, which hopefully\nfixes the last of the bugs with this feature, we\u0027ll be\nable to turn on this performance feature by default in\n2.6.38, and remove the mblk_io_submit option.)\n\nThe ext4 code path to bundle multiple pages for\nwriteback in ext4_bio_write_page() had a bug: we should\nbe clearing buffer head dirty flags *before* we submit\nthe bio, not in the completion routine.\n\nThe patch below was tested on 2.6.37 under KVM with the\npostgresql script which was submitted by Jon Nelson as\ndocumented in commit 1449032be1.\n\nWithout the patch, I\u0027d hit the corruption problem about\n50-70% of the time.  With the patch, I executed the\nscript \u003e 100 times with no corruption seen.\n\nI also fixed a bug to make sure ext4_end_bio() doesn\u0027t\ndereference the bio after the bio_put() call.\n\nReported-by: Jon Nelson \u003cjnelson@jamponi.net\u003e\nReported-by: Matthias Bayer \u003cjackdachef@gmail.com\u003e\nSigned-off-by: Curt Wohlgemuth \u003ccurtw@google.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nCc: stable@kernel.org\n"
    },
    {
      "commit": "13195184a8bc119dbd2f905db325a453047971cb",
      "tree": "828ccd332405a8334b18e3fb6b46c9d9bf8671a5",
      "parents": [
        "1f605b302724120777a1c38743cb20e2c8807333"
      ],
      "author": {
        "name": "Dan Carpenter",
        "email": "error27@gmail.com",
        "time": "Mon Jan 10 12:10:44 2011 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Jan 10 12:10:44 2011 -0500"
      },
      "message": "ext4: test the correct variable in ext4_init_pageio()\n\nThis is a copy and paste error.  The intent was to check\n\"io_page_cachep\".  We tested \"io_page_cachep\" earlier.\n\nSigned-off-by: Dan Carpenter \u003cerror27@gmail.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n\n"
    },
    {
      "commit": "b17b35ec13adfeb0346d4b329110b14adc509327",
      "tree": "4780d5dfb23a7c01a438f3680709ac1b849eabb1",
      "parents": [
        "6ca7b13dea385484e2fcc89790b8030697c5014a"
      ],
      "author": {
        "name": "Jesper Juhl",
        "email": "jj@chaosbits.net",
        "time": "Sun Dec 19 21:41:55 2010 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Sun Dec 19 21:41:55 2010 -0500"
      },
      "message": "ext4: use kmem_cache_zalloc() in ext4_init_io_end()\n\nUse advantage of kmem_cache_zalloc() to remove a memset() call in\next4_init_io_end() and save a few bytes.\n\nBefore:\n [jj@dragon linux-2.6]$ size fs/ext4/page-io.o\n    text    data     bss     dec     hex filename\n    3016       0     624    3640     e38 fs/ext4/page-io.o\nAfter:\n [jj@dragon linux-2.6]$ size fs/ext4/page-io.o\n    text    data     bss     dec     hex filename\n    3000       0     624    3624     e28 fs/ext4/page-io.o\n\nSigned-off-by: Jesper Juhl \u003cjj@chaosbits.net\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "08da1193d2c8c7a25d0cef7f85d0b9f1ad7c583a",
      "tree": "5a288945b73bc0ea79ca26e556f8061b51a85c1d",
      "parents": [
        "e53beacd23d9cb47590da6a7a7f6d417b941a994"
      ],
      "author": {
        "name": "Markus Trippelsdorf",
        "email": "markus@trippelsdorf.de",
        "time": "Wed Nov 17 21:46:06 2010 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Nov 17 21:46:06 2010 -0500"
      },
      "message": "ext4: fix setting random pages PageUptodate\n\next4_end_bio calls put_page and kmem_cache_free before calling\nSetPageUpdate(). This can result in setting the PageUptodate bit on\nrandom pages and causes the following BUG:\n\n BUG: Bad page state in process rm  pfn:52e54\n page:ffffea0001222260 count:0 mapcount:0 mapping:          (null) index:0x0\n arch kernel: page flags: 0x4000000000000008(uptodate)\n\nFix the problem by moving put_io_page() after the SetPageUpdate() call.\n\nThanks to Hugh Dickins for analyzing this problem.\n\nReported-by: Markus Trippelsdorf \u003cmarkus@trippelsdorf.de\u003e\nTested-by: Markus Trippelsdorf \u003cmarkus@trippelsdorf.de\u003e\nSigned-off-by: Markus Trippelsdorf \u003cmarkus@trippelsdorf.de\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "83668e7141c7a0aa4035bde94344b81f9cf966ab",
      "tree": "34d9fd52470b475d6e9d88ece8ca1ba80bf85a42",
      "parents": [
        "f7ad6d2e9201a6e1c9ee6530a291452eb695feb8"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Nov 08 13:45:33 2010 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Nov 08 13:45:33 2010 -0500"
      },
      "message": "ext4: fix potential race when freeing ext4_io_page structures\n\nUse an atomic_t and make sure we don\u0027t free the structure while we\nmight still be submitting I/O for that page.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "f7ad6d2e9201a6e1c9ee6530a291452eb695feb8",
      "tree": "006cdcfd487404fb61986e3030d96cb33866755d",
      "parents": [
        "ce7e010aef63dc6b37a2354f7c9f5f4aedb37978"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Nov 08 13:43:33 2010 -0500"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Mon Nov 08 13:43:33 2010 -0500"
      },
      "message": "ext4: handle writeback of inodes which are being freed\n\nThe following BUG can occur when an inode which is getting freed when\nit still has dirty pages outstanding, and it gets deleted (in this\nbecause it was the target of a rename).  In ordered mode, we need to\nmake sure the data pages are written just in case we crash before the\nrename (or unlink) is committed.  If the inode is being freed then\nwhen we try to igrab the inode, we end up tripping the BUG_ON at\nfs/ext4/page-io.c:146.\n\nTo solve this problem, we need to keep track of the number of io\ncallbacks which are pending, and avoid destroying the inode until they\nhave all been completed.  That way we don\u0027t have to bump the inode\ncount to keep the inode from being destroyed; an approach which\ndoesn\u0027t work because the count could have already been dropped down to\nzero before the inode writeback has started (at which point we\u0027re not\nallowed to bump the count back up to 1, since it\u0027s already started\ngetting freed).\n\nThanks to Dave Chinner for suggesting this approach, which is also\nused by XFS.\n\n  kernel BUG at /scratch_space/linux-2.6/fs/ext4/page-io.c:146!\n  Call Trace:\n   [\u003cffffffff811075b1\u003e] ext4_bio_write_page+0x172/0x307\n   [\u003cffffffff811033a7\u003e] mpage_da_submit_io+0x2f9/0x37b\n   [\u003cffffffff811068d7\u003e] mpage_da_map_and_submit+0x2cc/0x2e2\n   [\u003cffffffff811069b3\u003e] mpage_add_bh_to_extent+0xc6/0xd5\n   [\u003cffffffff81106c66\u003e] write_cache_pages_da+0x2a4/0x3ac\n   [\u003cffffffff81107044\u003e] ext4_da_writepages+0x2d6/0x44d\n   [\u003cffffffff81087910\u003e] do_writepages+0x1c/0x25\n   [\u003cffffffff810810a4\u003e] __filemap_fdatawrite_range+0x4b/0x4d\n   [\u003cffffffff810815f5\u003e] filemap_fdatawrite_range+0xe/0x10\n   [\u003cffffffff81122a2e\u003e] jbd2_journal_begin_ordered_truncate+0x7b/0xa2\n   [\u003cffffffff8110615d\u003e] ext4_evict_inode+0x57/0x24c\n   [\u003cffffffff810c14a3\u003e] evict+0x22/0x92\n   [\u003cffffffff810c1a3d\u003e] iput+0x212/0x249\n   [\u003cffffffff810bdf16\u003e] dentry_iput+0xa1/0xb9\n   [\u003cffffffff810bdf6b\u003e] d_kill+0x3d/0x5d\n   [\u003cffffffff810be613\u003e] dput+0x13a/0x147\n   [\u003cffffffff810b990d\u003e] sys_renameat+0x1b5/0x258\n   [\u003cffffffff81145f71\u003e] ? _atomic_dec_and_lock+0x2d/0x4c\n   [\u003cffffffff810b2950\u003e] ? cp_new_stat+0xde/0xea\n   [\u003cffffffff810b29c1\u003e] ? sys_newlstat+0x2d/0x38\n   [\u003cffffffff810b99c6\u003e] sys_rename+0x16/0x18\n   [\u003cffffffff81002a2b\u003e] system_call_fastpath+0x16/0x1b\n\nReported-by: Nick Bowler \u003cnbowler@elliptictech.com\u003e\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\nTested-by: Nick Bowler \u003cnbowler@elliptictech.com\u003e\n"
    },
    {
      "commit": "5dabfc78dcedbe46cb2e4872dde448de3cec2979",
      "tree": "804ef3e76289978ef6690c2b8f379a14a60b15f0",
      "parents": [
        "7f93cff90fa9be6ed45f6189e136153d1d8631b0"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Oct 27 21:30:14 2010 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Oct 27 21:30:14 2010 -0400"
      },
      "message": "ext4: rename {exit,init}_ext4_*() to ext4_{exit,init}_*()\n\nThis is a cleanup to avoid namespace leaks out of fs/ext4\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n"
    },
    {
      "commit": "bd2d0210cf22f2bd0cef72eb97cf94fc7d31d8cc",
      "tree": "f0d1902b7ff4294114614cc706855c3d6b131f73",
      "parents": [
        "1de3e3df917459422cb2aecac440febc8879d410"
      ],
      "author": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Oct 27 21:30:10 2010 -0400"
      },
      "committer": {
        "name": "Theodore Ts\u0027o",
        "email": "tytso@mit.edu",
        "time": "Wed Oct 27 21:30:10 2010 -0400"
      },
      "message": "ext4: use bio layer instead of buffer layer in mpage_da_submit_io\n\nCall the block I/O layer directly instad of going through the buffer\nlayer.  This should give us much better performance and scalability,\nas well as lowering our CPU utilization when doing buffered writeback.\n\nSigned-off-by: \"Theodore Ts\u0027o\" \u003ctytso@mit.edu\u003e\n\n"
    }
  ]
}
