| .. | .. |
|---|
| 700 | 700 | * is okay. The main goal is avoiding keeping an inode on |
|---|
| 701 | 701 | * the wrong wb for an extended period of time. |
|---|
| 702 | 702 | */ |
|---|
| 703 | | - if (hweight32(history) > WB_FRN_HIST_THR_SLOTS) |
|---|
| 703 | + if (hweight16(history) > WB_FRN_HIST_THR_SLOTS) |
|---|
| 704 | 704 | inode_switch_wbs(inode, max_id); |
|---|
| 705 | 705 | } |
|---|
| 706 | 706 | |
|---|
| .. | .. |
|---|
| 884 | 884 | continue; |
|---|
| 885 | 885 | } |
|---|
| 886 | 886 | |
|---|
| 887 | + /* |
|---|
| 888 | + * If wb_tryget fails, the wb has been shutdown, skip it. |
|---|
| 889 | + * |
|---|
| 890 | + * Pin @wb so that it stays on @bdi->wb_list. This allows |
|---|
| 891 | + * continuing iteration from @wb after dropping and |
|---|
| 892 | + * regrabbing rcu read lock. |
|---|
| 893 | + */ |
|---|
| 894 | + if (!wb_tryget(wb)) |
|---|
| 895 | + continue; |
|---|
| 896 | + |
|---|
| 887 | 897 | /* alloc failed, execute synchronously using on-stack fallback */ |
|---|
| 888 | 898 | work = &fallback_work; |
|---|
| 889 | 899 | *work = *base_work; |
|---|
| .. | .. |
|---|
| 892 | 902 | work->done = &fallback_work_done; |
|---|
| 893 | 903 | |
|---|
| 894 | 904 | wb_queue_work(wb, work); |
|---|
| 895 | | - |
|---|
| 896 | | - /* |
|---|
| 897 | | - * Pin @wb so that it stays on @bdi->wb_list. This allows |
|---|
| 898 | | - * continuing iteration from @wb after dropping and |
|---|
| 899 | | - * regrabbing rcu read lock. |
|---|
| 900 | | - */ |
|---|
| 901 | | - wb_get(wb); |
|---|
| 902 | 905 | last_wb = wb; |
|---|
| 903 | 906 | |
|---|
| 904 | 907 | rcu_read_unlock(); |
|---|