Thread (2 messages) 2 messages, 2 authors, 2025-11-25

Re: [PATCH v7 06/22] liveupdate: luo_file: implement file systems callbacks

From: Pasha Tatashin <pasha.tatashin@soleen.com>
Date: 2025-11-25 15:18:22
Also in: linux-doc, linux-fsdevel, linux-mm, lkml

quoted
+     if (err)
+             goto  err_files_mem;
 Nit:                ^^ two spaces here.
Removed.
quoted
+
+     if (file_set->count == LUO_FILE_MAX) {
+             err = -ENOSPC;
+             goto err_files_mem;
+     }
+
+     err = -ENOENT;
+     luo_list_for_each_private(fh, &luo_file_handler_list, list) {
+             if (fh->ops->can_preserve(fh, file)) {
+                     err = 0;
+                     break;
+             }
+     }
+
[...]
quoted
+int liveupdate_register_file_handler(struct liveupdate_file_handler *fh)
+{
+     struct liveupdate_file_handler *fh_iter;
+     int err;
+
+     if (!liveupdate_enabled())
+             return -EOPNOTSUPP;
+
+     /* Sanity check that all required callbacks are set */
+     if (!fh->ops->preserve || !fh->ops->unpreserve ||
+         !fh->ops->retrieve || !fh->ops->finish) {
 You are still missing a check for can_preserve() here. It is a mandatory
 callback and luo_preserve_file() calls it without checking for NULL.
Added.
 With these and Mike's comments addressed,

 Reviewed-by: Pratyush Yadav [off-list ref]
Thanks.
quoted
+             return -EINVAL;
+     }
+
[...]

--
Regards,
Pratyush Yadav
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help