<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>10349</bug_id>
          
          <creation_ts>2016-09-29 17:16:46 +0000</creation_ts>
          <short_desc>renameat() loses extended attributes</short_desc>
          <delta_ts>2016-10-06 15:46:31 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Pseudo</product>
          <component>pseudo</component>
          <version>master</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.2 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anton Gerasimov">anton</reporter>
          <assigned_to name="Joshua Lock">joshuagloe</assigned_to>
          <cc>anton</cc>
    
    <cc>joshuagloe</cc>
    
    <cc>seebs</cc>
    
    <cc>yp.pseudo.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66729</commentid>
    <comment_count>0</comment_count>
      <attachid>3445</attachid>
    <who name="Anton Gerasimov">anton</who>
    <bug_when>2016-09-29 17:16:46 +0000</bug_when>
    <thetext>Created attachment 3445
Utility to reproduce the bug

For some reason after renameat() extended attributes are no more there. Strangely enough it is not the case with plain rename(). The attached program gives no error in normal environment and outputs &quot;fgetattr: no data available&quot; in pseudo.

try as root: make; make test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66751</commentid>
    <comment_count>1</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2016-09-30 13:53:55 +0000</bug_when>
    <thetext>Huh. That&apos;s mildly surprising, renameat() shouldn&apos;t need to do anything about extended attributes unless it&apos;s moving across filesystems, since xattrs are stored by dev/inode. I&apos;ll try to get a look.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66755</commentid>
    <comment_count>2</comment_count>
    <who name="Anton Gerasimov">anton</who>
    <bug_when>2016-09-30 15:01:45 +0000</bug_when>
    <thetext>Thank you!
I was debugging communication from the client side (calls to pseudo_client_request) and the only difference between rename and renameat that I&apos;ve noticed is that rename (healthy one) OP_STATs the old file and doesn&apos;t OP_LINK it, while renameat (th buggy one) goes directly to OP_LINK without OP_STAT.
One can actually see the difference in ports/unix/guts/rename(at).c - lines 37-39 in rename.c that are missing in renameat.c. Could you please tell me, what is the reason for this difference? I couldn&apos;t figure it out yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66763</commentid>
    <comment_count>3</comment_count>
    <who name="Anton Gerasimov">anton</who>
    <bug_when>2016-09-30 15:50:10 +0000</bug_when>
    <thetext>I&apos;ve sent a patch with possible solution. I&apos;ve tested it shortly on my utility, but I don&apos;t know pseudo good enough to be sure that it doesn&apos;t break anything. Please take a look.

https://lists.yoctoproject.org/pipermail/poky/2016-September/010725.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67002</commentid>
    <comment_count>4</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2016-10-06 15:41:48 +0000</bug_when>
    <thetext>The patch is correct and is now merged in upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67006</commentid>
    <comment_count>5</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2016-10-06 15:46:31 +0000</bug_when>
    <thetext>Submitted for inclusion in the upcoming release:
http://lists.openembedded.org/pipermail/openembedded-core/2016-October/127359.html</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3445</attachid>
            <date>2016-09-29 17:16:46 +0000</date>
            <delta_ts>2016-09-29 17:16:46 +0000</delta_ts>
            <desc>Utility to reproduce the bug</desc>
            <filename>test-fsetxattr.tar.gz</filename>
            <type>application/gzip</type>
            <size>852</size>
            <attacher name="Anton Gerasimov">anton</attacher>
            
              <data encoding="base64">H4sIAFJL7VcAA+1WbW/aMBDmK/kVNzZpoQJKAhSpL5O2lA/TGJEoWlt1FUoTB6KGBNlOVdr1v+/s
hJaEvq1SO1Xy8wXf+bm7x/bZZOYEUcMtvSqaiK12W/wa3U5z9Veg1TKNkmF2uy2z3e62O6WmYZhb
7RI0X1dWioRxhwKU4gUP2CO8p+bfKT4GkRsmHoFdtmCblw7ntDH9ouXdfDEnbN2NO8fzXt+NeFgg
ci8MztZ8QZx3EUrjYmVOg2iS9yVRgMHCpwURhxl2L+hi5NCJWwN36tCNDWFcVLVrrRz4oIsZ+LAH
nSqgp0wuA67XjeqOVr7RBEOfnXsBFbSLE+O0Bs1up1NNuXOpSq9IRkWErIVjac/3YA/iOYnuktjj
4b496B/DH8DxwB5869vWD7Ts8f73Yc8a2cNjaVl9u3fUs+R4YFuj0bFILXTLtHuAtXJabKwDKIe4
PKaLe0RJTbeSHC4S1eSWnJhS2eEwU4bVh72vIznqHVn9VUG4D3hll1oekeIHIbl3a+RZQOTMCEqp
MOImNOCLBrnkJPKIV9lJKXDhhAk5ORWkgxjJ0q4sCzPCZVPqYhEiWS0l1IAFVyT2dWlVUW7hzESk
CLxfWxgzginRLrZA64UtMKa5Jmi9YROAH1OgROyO9/B5pIS1fpDSM7t9Kjek0Dwr07n2uRP+jDZ5
Ul7aLpQ43lgeKUpo4hQTxzzmwK7Q4U/Wu+EuQvRAep6gI30XzXxHTB7piFzhmROGsYtJZL6lBErY
MzRkQUKECPgHFUBCRmAZ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