On 11/25/2013 08:57 AM, Daniel P. Berrange wrote:
On Fri, Nov 22, 2013 at 08:20:29PM -0700, Eric Blake wrote:
> With this patch, dangling and looping symlinks are silently
> ignored, while links to files and directories are treated the
> same as the underlying file or directory. This is the same
> behavior as both 'directory' and 'netfs' pools.
>
> * src/storage/storage_backend_gluster.c
> (virStorageBackendGlusterRefreshVol): Treat symlinks similar to
> directory and netfs pools.
>
> Signed-off-by: Eric Blake <eblake(a)redhat.com>
> ---
> src/storage/storage_backend_gluster.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
ACK
Since I just added 'netdir' volume types, I'm wondering if I should also
add a 'badlink' volume type (covers both ENOENT and ELOOP errors).
After all, in a directory pool, you cannot create a new file with a name
occupied by a bad link without first deleting the bad link; and our
current behavior of silently ignoring bad links is a little unfriendly
when compared with actually telling the user that they have a broken
symlink, and without a way to use libvirt API to get the broken link out
of the way (you can't delete something that is silently ignored). But
that would be a followup patch, particularly since it affects directory
(and not just gluster) pools.
I've pushed this one as-is.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org