Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d37dd10b authored by Jinshan Xiong's avatar Jinshan Xiong Committed by Greg Kroah-Hartman
Browse files

staging/lustre/llite: deadlock for page write



Writing thread already locked page #1, and then wait for the
Writeback bit of page #2;

Ptlrpc thread is composing a write RPC, so it sets Writeback on
page #2 and tries to lock page #1 to make it ready.

Deadlocked.

Signed-off-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/9036
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4540


Reviewed-by: default avatarwangdi <di.wang@intel.com>
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c11599b8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -512,7 +512,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,

	/* To avoid deadlock, try to lock page first. */
	vmpage = grab_cache_page_nowait(mapping, index);
	if (unlikely(!vmpage || PageDirty(vmpage))) {
	if (unlikely(!vmpage || PageDirty(vmpage) || PageWriteback(vmpage))) {
		struct ccc_io *cio = ccc_env_io(env);
		struct cl_page_list *plist = &cio->u.write.cui_queue;

@@ -522,7 +522,7 @@ static int ll_write_begin(struct file *file, struct address_space *mapping,
		 * more grants. It's okay for the dirty page to be the first
		 * one in commit page list, though.
		 */
		if (vmpage && PageDirty(vmpage) && plist->pl_nr > 0) {
		if (vmpage && plist->pl_nr > 0) {
			unlock_page(vmpage);
			page_cache_release(vmpage);
			vmpage = NULL;