]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Over.pm
set nodatacow on more SQLite files
[public-inbox.git] / lib / PublicInbox / Over.pm
index 19da056a10aff5de4455e80c1e30b03190352258..98de82c048c86889c543cc3c871d647c5f7642c6 100644 (file)
@@ -16,9 +16,11 @@ use constant DEFAULT_LIMIT => 1000;
 sub dbh_new {
        my ($self, $rw) = @_;
        my $f = delete $self->{filename};
-       if (!-f $f) { # SQLite defaults mode to 0644, we want 0666
+       if (!-s $f) { # SQLite defaults mode to 0644, we want 0666
                if ($rw) {
                        require PublicInbox::Spawn;
+                       my ($dir) = ($f =~ m!(.+)/[^/]+\z!);
+                       PublicInbox::Spawn::nodatacow_dir($dir);
                        open my $fh, '+>>', $f or die "failed to open $f: $!";
                        PublicInbox::Spawn::nodatacow_fd(fileno($fh));
                } else {