diff options
| author | 2023-04-16 12:31:58 -0700 | |
|---|---|---|
| committer | 2023-04-16 12:31:58 -0700 | |
| commit | e492cd61b986590a45c674ede7dd1c4dbf94cf24 (patch) | |
| tree | 37dc59ea66842b5b7e57f32aba6cbce5143c1282 /fs/fs-writeback.c | |
| parent | sched/numa: use hash_32 to mix up PIDs accessing VMA (diff) | |
| parent | Revert "userfaultfd: don't fail on unrecognized features" (diff) | |
| download | wireguard-linux-e492cd61b986590a45c674ede7dd1c4dbf94cf24.tar.xz wireguard-linux-e492cd61b986590a45c674ede7dd1c4dbf94cf24.zip | |
sync mm-stable with mm-hotfixes-stable to pick up depended-upon upstream changes
Diffstat (limited to 'fs/fs-writeback.c')
| -rw-r--r-- | fs/fs-writeback.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 195dc23e0d83..1db3e3c24b43 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -978,6 +978,16 @@ restart: continue; } + /* + * If wb_tryget fails, the wb has been shutdown, skip it. + * + * Pin @wb so that it stays on @bdi->wb_list. This allows + * continuing iteration from @wb after dropping and + * regrabbing rcu read lock. + */ + if (!wb_tryget(wb)) + continue; + /* alloc failed, execute synchronously using on-stack fallback */ work = &fallback_work; *work = *base_work; @@ -986,13 +996,6 @@ restart: work->done = &fallback_work_done; wb_queue_work(wb, work); - - /* - * Pin @wb so that it stays on @bdi->wb_list. This allows - * continuing iteration from @wb after dropping and - * regrabbing rcu read lock. - */ - wb_get(wb); last_wb = wb; rcu_read_unlock(); |
