Re: [RFC] [PATCH] Fix copying/moving of metadata where source/dest metafile are not yet read



On Mon, 2005-09-19 at 16:42 +0200, Christian Neumair wrote:
> The attached patch tries to fix moving/copying of metadata if the source
> or destination metafile are not yet read. I'd like to get some feedback
> whether the overall architecture/resolution proposal looks sane. Maybe
> people familiar with async APIs do see some shortcomings/issues?

I had a quick look, and it seems sane. I worry a bit about ordering
though. What if someone first removes info for a file and then copies
some new info to it. The way this is resolved atm is by:
+
+	nautilus_metadata_process_ready_copies ();
+	nautilus_metadata_process_ready_removals ();

I.E. The copy will be done before the removal (if the source of the copy
is read), and the result will be that the newly copied info will be
removed. Maybe the two pending lists should be merged?

Even with a merged list there could be problems, e.g. in the example
above if the source of the copy was read after the target. I'm not sure
there is a way around this except with full-blown dependency tracking,
which seems a bit heavy. Could you ponder over the possibilities here?

> One question remains, though:
> What should we do if the metadata reading fails? For now, the copy
> process stays in pending_copies, possibly forever.

If the read of a metadata file fails, we should probably replace it with
a new empty file, and copy to/from that. A failure is likely to be
permanent, and there is just not much we can do with that file, so its
better to at least continue having a working metadata system, even if we
might overwrite some old info.

I doubt this is very common though.

Anyway, this clearly can't go in until after we branch. We'll do that
soon though, but i want to get the current batch of patches in first.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a notorious misogynist librarian who hangs with the wrong crowd. She's a 
man-hating extravagent politician living on borrowed time. They fight crime! 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]