Files
android_kernel_xiaomi_sm8450/fs/nfs
Trond Myklebust 61f454e30c pNFS: Fix a deadlock when coalescing writes and returning the layout
Consider the following deadlock:

Process P1	Process P2		Process P3
==========	==========		==========
					lock_page(page)

		lseg = pnfs_update_layout(inode)

lo = NFS_I(inode)->layout
pnfs_error_mark_layout_for_return(lo)

		lock_page(page)

					lseg = pnfs_update_layout(inode)

In this scenario,
- P1 has declared the layout to be in error, but P2 holds a reference to
  a layout segment on that inode, so the layoutreturn is deferred.
- P2 is waiting for a page lock held by P3.
- P3 is asking for a new layout segment, but is blocked waiting
  for the layoutreturn.

The fix is to ensure that pnfs_error_mark_layout_for_return() does
not set the NFS_LAYOUT_RETURN flag, which blocks P3. Instead, we allow
the latter to call LAYOUTGET so that it can make progress and unblock
P2.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
2017-05-02 12:35:33 -04:00
..
2017-04-21 10:45:01 -04:00
2017-04-20 13:33:09 -04:00
2017-04-26 13:03:04 -04:00
2017-04-20 15:51:23 -04:00
2017-04-20 15:51:23 -04:00
2012-07-30 19:06:41 -04:00
2015-02-03 11:06:34 -08:00
2016-03-31 00:30:15 -04:00
2017-04-20 13:39:35 -04:00
2015-04-23 15:16:14 -04:00
2015-04-23 15:16:14 -04:00
2016-05-17 15:47:55 -04:00
2012-07-30 19:06:52 -04:00
2017-04-21 10:45:01 -04:00
2017-04-20 14:00:41 -04:00
2017-01-30 13:14:50 -05:00
2016-07-20 23:30:06 -04:00
2017-04-26 13:03:04 -04:00