On Sun, 17 Mar 2019 at 00:59, Mark Syms <[email protected]> wrote:
>
> Sadly, this doesn't help and seems to make the situation worse. Our automated 
> tests were previously seeing about 5% failure rate and with this patch its 
> 20%.

So the PF_MEMALLOC flag doesn't get set on that code path. In that
case, we should probably check wbc->sync_mode instead. How about the
following?

diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 540535c..36de2f7 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -757,7 +757,7 @@ static int gfs2_write_inode(struct inode *inode,
struct writeback_control *wbc)
     bool flush_all = (wbc->sync_mode == WB_SYNC_ALL || gfs2_is_jdata(ip));

     /* (see ext4_dirty_inode) */
-    if (current->flags & PF_MEMALLOC)
+    if (wbc->sync_mode != WB_SYNC_ALL)
         return 0;

     if (flush_all)

It may help to wrap that condition in WARN_ON_ONCE for debugging.

> We still need to verify that they're all down to the same failure but I 
> thought it better to give some early feedback.
>
> Surprised that the script didn't run for you but the limit on dirty bytes was 
> just to get it to occur more frequently. You may have success with larger 
> values.

I'll keep trying to reproduce.

Thanks,
Andreas

Reply via email to