From e4854812c0f37d9d13a05a6bc4133126895e8143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Kr=C3=A4mer?= Date: Tue, 26 Apr 2016 18:29:45 +0200 Subject: [PATCH 1/5] added hardlink target for commit --- fuse/sfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fuse/sfs.c b/fuse/sfs.c index 3d86c38..3a24a96 100644 --- a/fuse/sfs.c +++ b/fuse/sfs.c @@ -253,6 +253,9 @@ int sfs_link(const char *path, const char *newpath) { retstat = -errno; } else { batch_file_event (newpath, "norec"); + // add old path as event too to ensure that hardlinks are + // created on targets when rsync -H is used + batch_file_event(path, "norec"); } return retstat; From 0a1060ebabee2f528aa069e67f626b7cae0262e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Kr=C3=A4mer?= Date: Sun, 15 Oct 2017 10:48:50 +0100 Subject: [PATCH 2/5] corrected error in preg_match --- php-sync/sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 php-sync/sync.php diff --git a/php-sync/sync.php b/php-sync/sync.php old mode 100644 new mode 100755 index a07c331..e276033 --- a/php-sync/sync.php +++ b/php-sync/sync.php @@ -457,7 +457,7 @@ public function linkLocalBatches () { } foreach ($batches as &$batch) { - if (!preg_match ("/^[^_]+_([^_]+)_[^.]+\.batch$/", $batch, $match)) { + if (!preg_match ("/^\d+_([^_]+)_.*\.batch$/", $batch, $match)) { continue; } $batchNode = $match[1]; From f8dbe712f928ae5149119b72e750bce686357c8a Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 18 Oct 2017 18:56:49 +0100 Subject: [PATCH 3/5] php-sync: Fix LOG_WARNING typo --- php-sync/sync.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-sync/sync.php b/php-sync/sync.php index e276033..4c84477 100755 --- a/php-sync/sync.php +++ b/php-sync/sync.php @@ -352,7 +352,7 @@ public function scheduleBatches ($mode, $toSchedule) { ) { # flush bulk if ($mtime === FALSE) { - syslog(LOG_WARN, "Cannot get mtime of $batchFile, assuming new bulk"); + syslog(LOG_WARNING, "Cannot get mtime of $batchFile, assuming new bulk"); } if ($bulkCount > 0) { $tasks[$rowno++][] = array($node, $bulk); From efc3084a2038398a3f6cf4dfcf0ce0efc152f27e Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 18 Oct 2017 18:58:14 +0100 Subject: [PATCH 4/5] fuse: Create files with open rather than creat, fixes #11 This allows additional flags to be passed, which fixes git. --- fuse/sfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuse/sfs.c b/fuse/sfs.c index 3a24a96..9e8a143 100644 --- a/fuse/sfs.c +++ b/fuse/sfs.c @@ -917,7 +917,7 @@ int sfs_create(const char *path, mode_t mode, struct fuse_file_info *fi) { sfs_fullpath(fpath, path); BEGIN_PERM; - fd = creat(fpath, mode); + fd = open(fpath, fi->flags, mode); END_PERM; if (fd < 0) { retstat = -errno; From 4f7710ecf8e8ffea38547a353deb85edab291830 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Wed, 18 Oct 2017 21:02:59 +0100 Subject: [PATCH 5/5] php-sync: Fix bug where no batches are flushed until BULK_OLDER_THAN Single batches were being effectively bulked regardless of BULK_MAX_BATCHES because $batch was being thrown away on each iteration. --- php-sync/sync.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/php-sync/sync.php b/php-sync/sync.php index 4c84477..fc586e5 100755 --- a/php-sync/sync.php +++ b/php-sync/sync.php @@ -359,8 +359,6 @@ public function scheduleBatches ($mode, $toSchedule) { } $bulk = array(); $bulkCount = 0; - $lastType = null; - break; // we don't send more than one bulk per node, anyway } $bulk[] = $batch;