Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / lustre / lustre / llite / rw26.c
index d98c7acc0832518287a3bccee2b5c36482ed55b7..2f8ef545a39d97554ce0b51531cc75494fe3325c 100644 (file)
@@ -161,7 +161,7 @@ static int ll_releasepage(struct page *vmpage, gfp_t gfp_mask)
        return result;
 }
 
-#define MAX_DIRECTIO_SIZE (2*1024*1024*1024UL)
+#define MAX_DIRECTIO_SIZE (2 * 1024 * 1024 * 1024UL)
 
 static inline int ll_get_user_pages(int rw, unsigned long user_addr,
                                    size_t size, struct page ***pages,
@@ -616,6 +616,13 @@ static int ll_write_end(struct file *file, struct address_space *mapping,
                        LASSERT(from == 0);
                vio->u.write.vui_to = from + copied;
 
+               /*
+                * To address the deadlock in balance_dirty_pages() where
+                * this dirty page may be written back in the same thread.
+                */
+               if (PageDirty(vmpage))
+                       unplug = true;
+
                /* We may have one full RPC, commit it soon */
                if (plist->pl_nr >= PTLRPC_MAX_BRW_PAGES)
                        unplug = true;
This page took 0.023731 seconds and 5 git commands to generate.