Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 969FF431FBC for ; Fri, 15 Jan 2010 17:42:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.211 X-Spam-Level: X-Spam-Status: No, score=0.211 tagged_above=-999 required=5 tests=[AWL=0.210, BAYES_50=0.001] autolearn=ham Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RDUKrNHscgYI for ; Fri, 15 Jan 2010 17:42:50 -0800 (PST) Received: from smtp5-g21.free.fr (smtp5-g21.free.fr [212.27.42.5]) by olra.theworths.org (Postfix) with ESMTP id 55424431FAE for ; Fri, 15 Jan 2010 17:42:48 -0800 (PST) Received: from smtp5-g21.free.fr (localhost [127.0.0.1]) by smtp5-g21.free.fr (Postfix) with ESMTP id 5883DD48052; Sat, 16 Jan 2010 02:42:41 +0100 (CET) Received: from zimbra1-e1.priv.proxad.net (zimbra1-e1.priv.proxad.net [172.20.243.151]) by smtp5-g21.free.fr (Postfix) with ESMTP id 59D76D48047; Sat, 16 Jan 2010 02:42:39 +0100 (CET) Date: Sat, 16 Jan 2010 02:42:39 +0100 (CET) From: racin@free.fr To: Ali Polatel Message-ID: <1728197861.1150741263606159152.JavaMail.root@zimbra1-e1.priv.proxad.net> In-Reply-To: <1961872606.1150531263605576704.JavaMail.root@zimbra1-e1.priv.proxad.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_33818_767327125.1263606159150" X-Originating-IP: [82.239.207.166] X-Mailer: Zimbra 5.0 (ZimbraWebClient - FF3.0 (Linux)/5.0.15_GA_2815.UBUNTU8_64) X-Authenticated-User: racin@free.fr Cc: notmuch@notmuchmail.org Subject: Re: [notmuch] Bug with commit 2e96464f9705be4ec772280cad71a6c9d5831e6f X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 01:42:51 -0000 ------=_Part_33818_767327125.1263606159150 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I still confirm the bug. The problem is due to relying on non-standardized fields of directory entri= es (i.e. d_type), which don't behave the same on reiserfs than on ext2 (I use reiserfs).=20 The following ugly patch "solves" my problem. diff --git a/notmuch-new.c b/notmuch-new.c index b740ee2..42d9f89 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -359,7 +359,7 @@ add_files_recursive (notmuch_database_t *notmuch, =20 if (! S_ISREG (st.st_mode)) continue; - } else if (entry->d_type !=3D DT_REG) { + } else if (entry->d_type !=3D DT_REG && entry->d_type !=3D 0) { continue; } With this patch, mails are added by the database, but some directories also= have d_type set to 0 and can slip through. It seems that the only portable way to test for directory types is stat, wh= ich is expensive... I don't known what's the best way to go. Matthieu ----- Mail Original ----- De: "Ali Polatel" =C3=80: notmuch@notmuchmail.org Envoy=C3=A9: Mercredi 13 Janvier 2010 11h21:52 GMT +01:00 Amsterdam / Berli= n / Berne / Rome / Stockholm / Vienne Objet: Re: [notmuch] Bug with commit 2e96464f9705be4ec772280cad71a6c9d5831e= 6f Ali Polatel yazm=C4=B1=C5=9F: > racin@free.fr yazm=C4=B1=C5=9F: > > Hello, > >=20 > > I just updated notmuch and now notmuch new cannot update my mail anymor= e... It tells me that there are > > 700 files found, but tells that there's no new mail. > >=20 > > I did a git bisect, which tells me the first bad commit is commit 2e964= 64f9705be4ec772280cad71a6c9d5831e6f. > >=20 > > I did not try to use the new xapian database or to update xapian; maybe= this is the problem. > >=20 > > I tested with several tools to get mail in the maildir format, includin= g mb2md and getmail, and I always get the problem. > Same problem here, I tried upgrading xapian to xapian-core-1.1.3_svn13824= , the problem persists. > Here's what happens here: > 3074 alip@harikalardiyari> rm -fr .maildir/.notmuch > 3075 alip@harikalardiyari> notmuch new > Found 210302 total files (that's not much mail). > No new mail. > 3076 alip@harikalardiyari> notmuch search from:alip@exherbo.org > 3077 alip@harikalardiyari> >=20 After doing git bisect which gave random results and testing notmuch using cworth's notmuch-test script on another file system I figured out my problem was due to file system corruption. Sorry for the noise... --=20 Regards, Ali Polatel _______________________________________________ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch ------=_Part_33818_767327125.1263606159150 Content-Type: application/octet-stream; name=patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=patch diff --git a/notmuch-new.c b/notmuch-new.c index b740ee2..a972390 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -153,7 +153,7 @@ _entries_resemble_maildir (struct dirent **entries, int count) int i, found = 0; for (i = 0; i < count; i++) { - if (entries[i]->d_type != DT_DIR) + if (entries[i]->d_type != DT_DIR || entries[i]->d_type != DT_UNKNOWN) continue; if (strcmp(entries[i]->d_name, "new") == 0 || @@ -273,8 +273,8 @@ add_files_recursive (notmuch_database_t *notmuch, entry = fs_entries[i]; - if (entry->d_type != DT_DIR && entry->d_type != DT_LNK) - continue; + if (entry->d_type != DT_DIR && entry->d_type != DT_LNK && entry->d_type != DT_UNKNOWN) + continue; /* Ignore special directories to avoid infinite recursion. * Also ignore the .notmuch directory and any "tmp" directory @@ -359,7 +359,7 @@ add_files_recursive (notmuch_database_t *notmuch, if (! S_ISREG (st.st_mode)) continue; - } else if (entry->d_type != DT_REG) { + } else if (entry->d_type != DT_REG && entry->d_type != 0) { continue; } ------=_Part_33818_767327125.1263606159150--