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

Re: [Xen-devel] [PATCH] tools/xenstore: Do not abort xenstore-ls if a node disappears while iterating



On Mon, 2019-03-04 at 15:46 +0000, Wei Liu wrote:
> To me it is just a bit weird to guard with cur_depth -- if you really
> want to continue at all cost, why don't you make it really continue at
> all cost?

There isn't another early exit from the loop. It really does continue
at all costs.

The only exception is when cur_depth==0 because that means xenstore-ls
was actually invoked on a path that doesn't exist at all. In that case
it *should* print the 'No such file or directory' message. And
continuing in that case would be meaningless anyway, since it won't
have found any child directories to iterate over anyway, so it would
just silently exit.

> Also you mentioned "a node disappears", I thought that was the case you
> cared about, hence my suggestion.

That's my primary use case, yes. Obviously we should make it do the
right thing in the general case while we're thinking about it. I'm
inclined to go with Juergen's suggestion of ignoring ENOENT and EACCES
(or should that have been EPERM?), yet still aborting for everything
else.


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.