Current version of snapper (commit 50dec40) bails out with this error
if .snapshots directory doesn't exist (as is the case on new snapper
install):

2012-04-10 16:15:30,241 ERROR libsnapper(17784)
Snapshot.cc(nextNumber):362 - mkdir failed errno:2 (No such file or
directory)

This patch tries to create .snapshots dir unconditionally.

Signed-off-by: Fajar A. Nugraha <git...@fajar.net>
---
 snapper/Snapshot.cc |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/snapper/Snapshot.cc b/snapper/Snapshot.cc
index 8e9cc37..277fad7 100644
--- a/snapper/Snapshot.cc
+++ b/snapper/Snapshot.cc
@@ -353,6 +353,9 @@ namespace snapper
            if (snapper->getFilesystem()->checkSnapshot(num))
                continue;

+           // try to create .snapshots dir unconditionally
+           mkdir(snapper->infosDir().c_str(), 0711);
+
            if (mkdir((snapper->infosDir() + "/" + decString(num)).c_str(),
0777) == 0)
                break;

-- 
1.7.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to