OSDN Git Service

f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / fs-writeback.c
index de1138e..1757d1c 100644 (file)
@@ -582,10 +582,13 @@ void wbc_attach_and_unlock_inode(struct writeback_control *wbc,
        spin_unlock(&inode->i_lock);
 
        /*
-        * A dying wb indicates that the memcg-blkcg mapping has changed
-        * and a new wb is already serving the memcg.  Switch immediately.
+        * A dying wb indicates that either the blkcg associated with the
+        * memcg changed or the associated memcg is dying.  In the first
+        * case, a replacement wb should already be available and we should
+        * refresh the wb immediately.  In the second case, trying to
+        * refresh will keep failing.
         */
-       if (unlikely(wb_dying(wbc->wb)))
+       if (unlikely(wb_dying(wbc->wb) && !css_is_dying(wbc->wb->memcg_css)))
                inode_switch_wbs(inode, wbc->wb_id);
 }
 
@@ -1750,8 +1753,7 @@ static long wb_writeback(struct bdi_writeback *wb,
                 * safe.
                 */
                if (work->for_kupdate) {
-                       oldest_jif = jiffies -
-                               msecs_to_jiffies(dirty_expire_interval * 10);
+                       oldest_jif = jiffies - (30 * HZ);
                } else if (work->for_background)
                        oldest_jif = jiffies;