I still confirm the bug.

The problem is due to relying on non-standardized fields of directory entries 
(i.e. d_type), which don't behave the
same on reiserfs than on ext2 (I use reiserfs). 

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,
            if (! S_ISREG (st.st_mode))
-       } else if (entry->d_type != DT_REG) {
+       } else if (entry->d_type != DT_REG && entry->d_type != 0) {

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, which 
is expensive... I don't known
what's the best way to go.


----- Mail Original -----
De: "Ali Polatel" <a...@exherbo.org>
À: notmuch@notmuchmail.org
Envoyé: Mercredi 13 Janvier 2010 11h21:52 GMT +01:00 Amsterdam / Berlin / Berne 
/ Rome / Stockholm / Vienne
Objet: Re: [notmuch] Bug with commit 2e96464f9705be4ec772280cad71a6c9d5831e6f

Ali Polatel yazmış:
> ra...@free.fr yazmış:
> > Hello,
> > 
> > I just updated notmuch and now notmuch new cannot update my mail anymore... 
> > It tells me that there are
> > 700 files found, but tells that there's no new mail.
> > 
> > I did a git bisect, which tells me the first bad commit is commit 
> > 2e96464f9705be4ec772280cad71a6c9d5831e6f.
> > 
> > I did not try to use the new xapian database or to update xapian; maybe 
> > this is the problem.
> > 
> > I tested with several tools to get mail in the maildir format, including 
> > 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 a...@harikalardiyari> rm -fr .maildir/.notmuch
> 3075 a...@harikalardiyari> notmuch new
> Found 210302 total files (that's not much mail).
> No new mail.
> 3076 a...@harikalardiyari> notmuch search from:a...@exherbo.org
> 3077 a...@harikalardiyari>

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...

Ali Polatel

notmuch mailing list

Attachment: patch
Description: Binary data

notmuch mailing list

Reply via email to