Ernesto A. Fernández 19a9d0f1ac hfsplus: fix BUG on bnode parent update
Creating, renaming or deleting a file may hit BUG_ON() if the first
record of both a leaf node and its parent are changed, and if this
forces the parent to be split.  This bug is triggered by xfstests
generic/027, somewhat rarely; here is a more reliable reproducer:

  truncate -s 50M fs.iso
  mkfs.hfsplus fs.iso
  mount fs.iso /mnt
  i=1000
  while [ $i -le 2400 ]; do
    touch /mnt/$i &>/dev/null
    ((++i))
  done
  i=2400
  while [ $i -ge 1000 ]; do
    mv /mnt/$i /mnt/$(perl -e "print $i x61") &>/dev/null
    ((--i))
  done

The issue is that a newly created bnode is being put twice.  Reset
new_node to NULL in hfs_brec_update_parent() before reaching goto again.

Link: http://lkml.kernel.org/r/5ee1db09b60373a15890f6a7c835d00e76bf601d.1535682461.git.ernesto.mnd.fernandez@gmail.com
Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-31 08:54:13 -07:00
..
2018-10-30 08:27:13 -07:00
2018-09-04 11:35:03 +08:00
2018-08-21 23:54:17 -04:00
\n
2018-10-29 10:23:36 -07:00
2018-08-21 18:47:36 -07:00
2018-08-17 16:20:28 -07:00
2018-09-29 22:47:48 -04:00
2018-10-26 16:26:33 -07:00
2018-05-22 14:27:52 -04:00
2018-10-21 10:46:42 -04:00
2018-08-17 16:20:27 -07:00
2018-10-24 14:42:02 +01:00
2018-05-22 14:27:52 -04:00
2018-08-18 11:44:53 -07:00
2018-09-07 10:32:23 +02:00
2018-10-18 17:21:55 +11:00
2018-07-03 16:44:45 -04:00
2018-08-14 10:23:25 -07:00
2018-10-29 14:29:58 -07:00
2018-06-05 19:23:26 +02:00
2018-08-21 18:19:09 -07:00
2018-10-21 10:46:42 -04:00
2018-10-21 10:46:44 -04:00
2018-08-21 18:19:09 -07:00
2018-06-11 08:22:34 -07:00
2018-08-21 18:19:09 -07:00
2018-02-15 15:34:42 -05:00
2018-08-21 18:19:09 -07:00
2018-09-03 15:14:01 +02:00
2018-04-04 12:44:02 -07:00