<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" content="text/html; charset=UTF-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";
        mso-fareast-language:EN-GB;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><a href="http://stackoverflow.com/questions/9535653/file-rename-on-ext3-appears-to-break-posix-spec">http://stackoverflow.com/questions/9535653/file-rename-on-ext3-appears-to-break-posix-spec</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I posted the above to stackoverflow – I am running a test does repeated file renames to a target file in one thread, and repeatedly reads that target file in another thread. This works fine except when there is a hard-link to the file being renamed to the target file. In this case the reading thread hits file not found errors (not always but often). This seems to break the sped for ‘rename’.  <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The test is:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>    #!/bin/bash<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>    touch target;<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>    for ((i=0; i < 1000; i=i+1)); do<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>        echo "snafu$i" > $1/file$i;<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>        ln $1/file$i $1/link$i<o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>        mv -f $1/file$i $1/target; <o:p></o:p></span></p><p class=MsoNormal style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:EN-GB'>    done; </span><span style='font-size:10.5pt;font-family:Consolas;color:black;mso-fareast-language:EN-GB'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>and the reading side:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><pre style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><code><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE'>    #!/bin/bash<o:p></o:p></span></code></pre><pre style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><code><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE'>    while(true);do <o:p></o:p></span></code></pre><pre style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><code><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE'>        cat $1/target; <o:p></o:p></span></code></pre><pre style='line-height:13.5pt;background:#EEEEEE;vertical-align:baseline'><code><span style='font-size:10.5pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE'>    done</span></code><span style='font-size:10.5pt;font-family:Consolas;color:black'><o:p></o:p></span></pre><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>if the linking step is removed from the writing thread, then no errors are seen as expected. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Does anyone know why the presence of the link causes read errors during the rename? I tried creating all the temporary files and links first, then pausing and then doing the rename loop – same erros are seen on the reading side. <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div><p align="justify"><font color="#666666" size="1" face="arial,helvetica,sans-serif"><font color="#999999">This email has been sent by a member of the Man group (“Man”). Man’s parent company, Man Group plc, is registered in England and Wales (company number 2921462) at Riverbank House, 2 Swan  Lane, London, EC4R 3AD.<br />The contents of this email are for the named addressee(s) only. It contains information which may be confidential and privileged. If you are not the intended recipient, please notify the sender immediately, destroy this email and any attachments and do not otherwise disclose or use them. Email transmission is not a secure method of communication and Man cannot accept responsibility for the completeness or accuracy of this email or any attachments. Whilst Man makes every effort to keep its network free from viruses, it does not accept responsibility for any computer virus which might be transferred by way of this email or any attachments. This email does not constitute a request, offer, recommendation or solicitation of any kind to buy, subscribe, sell or redeem any investment instruments or to perform other such transactions of any kind. Man reserves the right to monitor, record and retain all electronic and telephone communications through its network in accordance with applicable laws and regulations.</font> <font color="#cccccc">--UwQe9f5k7pI3vplngP</font></font></p>
</body></html>