When mas_prev() does not find anything, set the state to MAS_NONE.
Handle the MAS_NONE in mas_find() like a MAS_START.
Link: https://lkml.kernel.org/r/20230120162650.984577-7-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Reported-by: <syzbot+502859d610c661e56545@syzkaller.appspotmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
 
        if (mas->index < min) {
                mas->index = mas->last = min;
-               mas_pause(mas);
+               mas->node = MAS_NONE;
                return NULL;
        }
 retry:
        if (!mas->index) {
                /* Nothing comes before 0 */
                mas->last = 0;
+               mas->node = MAS_NONE;
                return NULL;
        }
 
                mas->index = ++mas->last;
        }
 
+       if (unlikely(mas_is_none(mas)))
+               mas->node = MAS_START;
+
        if (unlikely(mas_is_start(mas))) {
                /* First run or continue */
                void *entry;