backend: update cookie even on callback failure

No need to check status and always update cookie after
invoking callback for bookmark_list() and bookmark_fsck().
This commit is contained in:
CismonX 2025-02-01 00:21:02 +08:00
parent 78b80be2e5
commit 88e38bd38e
No known key found for this signature in database
GPG key ID: 3094873E29A482FB
2 changed files with 1 additions and 19 deletions

View file

@ -1906,9 +1906,6 @@ bookmark_fsck (
status = fsck_apply(ctx, id, fsck_data, callback, user_data); status = fsck_apply(ctx, id, fsck_data, callback, user_data);
#endif #endif
} }
if (status < 0) {
return status;
}
end: end:
if (cookie_ptr != NULL) { if (cookie_ptr != NULL) {
@ -2053,10 +2050,7 @@ bookmark_list (
continue; continue;
} }
status = callback(user_data, &buf); status = callback(user_data, &buf);
if (status < 0) { if (status != 0) {
return status;
}
if (status > 0) {
break; break;
} }
} }

View file

@ -3056,12 +3056,6 @@ bookmark_fsck (
status = fsck_apply(ctx, id, fsck_data, &qctx); status = fsck_apply(ctx, id, fsck_data, &qctx);
#endif #endif
} }
if (status < 0) {
if (dentry_map == NULL) {
free_dentmap(qctx.dentry_map);
}
return status;
}
dentry_map = qctx.dentry_map; dentry_map = qctx.dentry_map;
idx = qctx.next; idx = qctx.next;
@ -3165,12 +3159,6 @@ bookmark_list (
qctx.callback.list = callback; qctx.callback.list = callback;
qctx.user_data = user_data; qctx.user_data = user_data;
status = bookmark_do_list(ctx, id, off, flags, &qctx); status = bookmark_do_list(ctx, id, off, flags, &qctx);
if (status < 0) {
if (dentry_map == NULL) {
free_dentmap(qctx.dentry_map);
}
return status;
}
dentry_map = qctx.dentry_map; dentry_map = qctx.dentry_map;
end: end: