Re: [Courier-imap] courier-imapd and OCFS2
Brought to you by:
mrsam
|
From: Dan G. <da...@ra...> - 2015-02-11 11:00:55
|
Hi, Thanks for your timing looking over what I'd found. You do make a very good point about the error code being return and the behaviour of Thunderbird. I'll do a little more digging in the source for ocfs2 and Thunderbird, see if I can spot the issues and raise issues in their upstreams. Regards Dan On 11/02/15 00:18, Sam Varshavchik wrote: > Dan Goodliffe writes: > >> OK, I probably should have done this 6 months ago.. but it seems that >> OCFS2 simply doesn't allow hard links across different directories. > > And that happens to be the same story with AFS, hence the existing code. > >> defiant ~ $ mkdir 1 2 >> defiant ~ $ touch 1/a >> defiant ~ $ ls 1/ >> a >> defiant ~ $ ln 1/a 2/a >> ln: failed to create hard link '2/a' => '1/a': No such file or directory > > So, what appears to be the case is that OCFS2's kernel returns an > ENOENT to the client, which is absurd. EXDEV is the right error code > for this situation. > > Two observations: > > 1) Encountering this error should not result in any actual lost mail. > The server should return an error the the IMAP client, if it's an IMAP > client that tries to add a new message or move messages between > folders. If an IMAP client assumes that the operation will always > succeed, and ignores the error message, it's the client's fault. If > the message is being delivered to a mailbox, via deliverquota or > maildrop, this should also result in an error and a non-zero exit > code, which the sending mail server should handle by keeping the mail > in its mail queue. > > 2) There are reasons why link() is used, but that's besides the point. > > >> > if (errno != EXDEV) > > > If you change this to > > if (errno != EXDEV && errno != ENOENT) > > then this should also work. > >> > Any thoughts very welcome. I'm planning on raising this upstream, but > > Tell upstream to give you a logical explanation why ENOENT is a better > error code than EXDEV, whose POSIX definition is: > > EXDEV Improper link (POSIX.1) > > I'd like to see someone make an argument that, in this situation > > ENOENT No such file or directory (POSIX.1) > > makes more sense. Someone explain to me which "file or directory" does > not exist here. As your example showed, everything exists just fine. > > The reason why you can't link across multiple directories is probably > because with OCFS2, like AFS, a sysadmin can migrate any directory > hierarchy between different physical servers that make up the virtual > filesystem hierarchy. So, if you link a file across multiple > directories, you wouldn't be able to migrate any intermediate part of > the virtual filesystem hierarchy. > > The issue here is not really that you can't do it, it's just that the > error code returned to the application is confusing. > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > > > _______________________________________________ > Courier-imap mailing list > Cou...@li... > Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap |