Since we have multiple cgwb per bdi, embedded in writeback_ctx now, we
iterate over all of them to find the associated writeback.

Signed-off-by: Kundan Kumar <kundan.ku...@samsung.com>
Signed-off-by: Anuj Gupta <anuj2...@samsung.com>
---
 fs/fs-writeback.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 9529e16c9b66..72b73c3353fe 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -1091,6 +1091,7 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
        struct backing_dev_info *bdi;
        struct cgroup_subsys_state *memcg_css;
        struct bdi_writeback *wb;
+       struct bdi_writeback_ctx *bdi_wb_ctx;
        struct wb_writeback_work *work;
        unsigned long dirty;
        int ret;
@@ -1114,7 +1115,11 @@ int cgroup_writeback_by_id(u64 bdi_id, int memcg_id,
         * And find the associated wb.  If the wb isn't there already
         * there's nothing to flush, don't create one.
         */
-       wb = wb_get_lookup(bdi->wb_ctx_arr[0], memcg_css);
+       for_each_bdi_wb_ctx(bdi, bdi_wb_ctx) {
+               wb = wb_get_lookup(bdi_wb_ctx, memcg_css);
+               if (wb)
+                       break;
+       }
        if (!wb) {
                ret = -ENOENT;
                goto out_css_put;
-- 
2.25.1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to