Hello Saggi Mizrahi,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/9817
to review the following change.
Change subject: mount.py: handle (deleted) mount points
......................................................................
mount.py: handle (deleted) mount points
If an NFS mount is removed from the server, client side kernel appends
" (deleted)" to it specification. It comes from fs/dcache.c's d_path()
function:
Convert a dentry into an ASCII path name. If the entry has been deleted
the string " (deleted)" is appended. Note that this is ambiguous.
In this patch we assume that every mount specification ending with this
string is indeed a deleted one, and not a funky nfs server provided by
an evil admin that hates Linux.
Change-Id: Ifb02976429d0b0c806b8754207d263e17dd7f59f
Bug-Url: http://bugzilla.redhat.com/807351
Signed-off-by: Saggi Mizrahi <[email protected]>
Signed-off-by: Dan Kenigsberg <[email protected]>
---
M vdsm/storage/mount.py
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/17/9817/1
diff --git a/vdsm/storage/mount.py b/vdsm/storage/mount.py
index aaa9eb0..81ca17f 100644
--- a/vdsm/storage/mount.py
+++ b/vdsm/storage/mount.py
@@ -46,7 +46,15 @@
fs_freq = int(fs_freq)
fs_passno = int(fs_passno)
fs_spec = normpath(_parseFstabPath(fs_spec))
+
fs_file = normpath(_parseFstabPath(fs_file))
+ for suffix in (" (deleted)", ):
+ if not fs_file.endswith(suffix):
+ continue
+
+ fs_file = fs_file[:-len(suffix)]
+ break
+
fs_mntops = [_parseFstabPath(item) for item in fs_mntops]
return MountRecord(fs_spec, fs_file, fs_vfstype, fs_mntops,
--
To view, visit http://gerrit.ovirt.org/9817
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb02976429d0b0c806b8754207d263e17dd7f59f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Saggi Mizrahi <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches