]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_mail_sync: do not disable CoW for this DB
authorEric Wong <e@80x24.org>
Thu, 13 May 2021 07:00:05 +0000 (07:00 +0000)
committerEric Wong <e@80x24.org>
Sat, 15 May 2021 05:39:17 +0000 (05:39 +0000)
This is rather critical data for synchronization,
especially when "lei index" is used instead of "lei import"

lib/PublicInbox/LeiMailSync.pm

index d8242de381c0441dc510b5e1a30e00a0bf9a2c14..803de48c176cc3a7d625838b0282a52a24492d13 100644 (file)
@@ -11,13 +11,7 @@ use PublicInbox::ContentHash qw(git_sha);
 sub dbh_new {
        my ($self, $rw) = @_;
        my $f = $self->{filename};
-       my $creat;
-       if (!-f $f && $rw) {
-               require PublicInbox::Spawn;
-               open my $fh, '+>>', $f or die "failed to open $f: $!";
-               PublicInbox::Spawn::nodatacow_fd(fileno($fh));
-               $creat = 1;
-       }
+       my $creat = $rw && !-s $f;
        my $dbh = DBI->connect("dbi:SQLite:dbname=$f",'','', {
                AutoCommit => 1,
                RaiseError => 1,