it first see a lock file. This time is used to calculate the age of
the lock.
+With version 3.0-17, it is possible to update an existing lock using
+
+ utime 0, time();
+
+This succeeds if run from the same node you created the lock, and updates
+the lock lifetime for another 120 seconds.
+
References
==========
goto ret;
}
+ int is_lock = (strcmp(dirname, "priv/lock") == 0) && (te->type == DT_DIR);
+
/* NOTE: we use utime(0,0) to trigger 'unlock', so we do not
* allow to change mtime for locks (only it mtime is newer).
* See README for details about locks.
*/
- if (mtime < te->mtime && te->type == DT_DIR &&
- strcmp(dirname, "priv/lock") == 0) {
+ if (is_lock) {
+ if (mtime < te->mtime) {
cfs_debug("dir is locked");
ret = -EACCES;
goto ret;
+ } else {
+ /* only allow lock updates if the writer is the same */
+ if (te->writer != writer) {
+ ret = -EACCES;
+ goto ret;
+ }
+ }
}
-
memdb->root->version++;
memdb->root->mtime = mtime;
memdb->root->writer = writer;
goto ret;
}
+ if (is_lock) {
+ cfs_debug("update cfs lock");
+ g_hash_table_remove(memdb->locks, path);
+ guchar csum[32];
+ if (memdb_tree_entry_csum(te, csum)) {
+ memdb_lock_expired(memdb, path, csum); // insert a new entry
+ }
+ }
+
ret = 0;
ret:
+pve-cluster (3.0-17) unstable; urgency=low
+
+ * add ability to update cfs locks
+
+ -- Proxmox Support Team <support@proxmox.com> Thu, 19 Feb 2015 11:56:06 +0100
+
pve-cluster (3.0-16) unstable; urgency=low
* recompile, and include new package with debug information