This reply is as much for people who have this problem and find this
thread in the archives...
The root cause of the issue has been fixed in kernels v3.19.0 onwards.
There's an open Gentoo bug here
https://bugs.gentoo.org/show_bug.cgi?id=540010 which references a page
detailing a patch to fix the problem here
https://lkml.org/lkml/2015/1/27/289. That patch actually makes hard
links across directories work properly rather than just fixing the error
code, which is a good win. The other good win is that very patch can
even been applied quite a long way back. I'm now running 3.14.27 happily
with it applied.
Thanks for your time.
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
> Courier-imap@lists.sourceforge.net
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Courier-imap mailing list
Courier-imap@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-imap