Brian Behlendorf 4c837f0d93 Fix "allocating allocated segment" panic
Gunnar Beutner did all the hard work on this one by correctly
identifying that this issue is a race between dmu_sync() and
dbuf_dirty().

Now in all cases the caller is responsible for preventing this
race by making sure the zfs_range_lock() is held when dirtying
a buffer which may be referenced in a log record.  The mmap
case which relies on zfs_putpage() was not taking the range
lock.  This code was accidentally dropped when the function
was rewritten for the Linux VFS.

This patch adds the required range locking to zfs_putpage().

It also adds the missing ZFS_ENTER()/ZFS_EXIT() macros which
aren't strictly required due to the VFS holding a reference.
However, this makes the code more consistent with the upsteam
code and there's no harm in being extra careful here.

Original-patch-by: Gunnar Beutner <gunnar@beutner.name>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #541
2012-11-09 19:01:09 -08:00
..
2012-10-12 10:03:03 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-10-29 08:57:45 -07:00
2010-08-26 14:24:34 -07:00
2010-08-31 13:41:58 -07:00
2012-10-08 10:19:05 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-11-09 12:24:51 -08:00
2010-08-31 08:38:45 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-11-02 15:45:56 -07:00
2012-09-17 11:22:23 -07:00
2010-08-31 13:41:58 -07:00
2012-10-15 16:01:54 -07:00
2010-08-31 08:38:46 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2010-12-07 16:05:25 -08:00
2012-08-27 12:01:37 -07:00
2010-08-31 13:41:59 -07:00
2010-08-31 13:41:58 -07:00
2012-08-27 12:01:37 -07:00
2010-08-31 13:41:58 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-11-02 15:45:56 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2012-10-22 10:17:10 -07:00
2012-08-27 12:01:37 -07:00
2012-09-05 08:44:58 -07:00
2012-09-05 08:44:58 -07:00
2012-08-27 12:01:37 -07:00
2012-08-27 12:01:37 -07:00
2010-08-31 13:41:58 -07:00
2012-02-09 16:37:48 -08:00
2012-08-26 13:55:45 -07:00
2011-03-02 11:44:34 -08:00
2012-10-03 13:59:02 -07:00
2010-08-31 13:41:50 -07:00
2012-09-17 11:06:58 -07:00
2012-08-27 12:01:37 -07:00
2011-05-04 10:02:37 -07:00
2012-10-14 13:06:54 -07:00
2012-10-14 14:42:25 -07:00
2010-09-17 16:24:15 -07:00
2012-10-05 12:39:59 -07:00