<?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>10623</bug_id>
          
          <creation_ts>2016-11-08 15:36:24 +0000</creation_ts>
          <short_desc>removing hardlink removes xattrs</short_desc>
          <delta_ts>2017-02-16 10:49:06 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</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.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Joshua Lock">joshuagloe</assigned_to>
          <cc>benjamin.esquivel</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>68092</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-08 15:36:24 +0000</bug_when>
    <thetext>Bug #9317 fixed the missing sharing of xattrs when creating hardlinks: if foo has an xattr and bar is hard-linked to it, bar must share xattrs with foo.

However, now something else is broken: when deleting bar in the example above, the xattrs are also deleted despite still being used by foo.

To reproduce using roughly OE-core (= pseudo 1.8.1) with a local patch for the xattr corruption bug:

$ rm -rf foo bar /tmp/pseudo; env PSEUDO_PREFIX=tmp-glibc/sysroots/x86_64-linux/usr PSEUDO_PASSWD=tmp-glibc/work/intel_corei7_64-ostro-linux/ostro-image-swupd/1.0-r0/rootfs:tmp-glibc/sysroots/x86_64-linux PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0 PSEUDO_LOCALSTATEDIR=/tmp/pseudo tmp-glibc/sysroots/x86_64-linux/usr/bin/pseudo sh -c &apos;set -x; touch foo; setfattr -n security.SMACK64 -v System::Shared foo; ln foo bar; getfattr -d -m . foo bar; rm bar; getfattr -d -m . foo&apos;

+ touch foo
+ setfattr -n security.SMACK64 -v System::Shared foo
+ ln foo bar
+ getfattr -d -m . foo bar
# file: foo
security.SMACK64=&quot;System::Shared&quot;

# file: bar
security.SMACK64=&quot;System::Shared&quot;

+ rm bar
+ getfattr -d -m . foo
# no output from getfattr here

This shows that bug #9317 is fixed (bar has same xattr as foo). But after &quot;rm bar&quot;, &quot;getfattr foo&quot; should still show the same xattr as before and doesn&apos;t.

This blocks further work on improving meta-swupd because the main directory tree gets corrupted after swupd_make_pack from zero. Current usage of meta-swupd is not affected because it only uses the tree once, but that&apos;s meant to change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68140</commentid>
    <comment_count>1</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2016-11-08 18:02:54 +0000</bug_when>
    <thetext>So this is a side-effect of the performance fixes from a bit back. When we delete a file, we used to nuke any xattrs with no remaining files. Now we delete only the xattrs that match the deleted file... But delete them even if other files still match. Should be fixable.

This thing here: DELETE FROM xattrs WHERE dev = ? AND ino = ?;

should probably be something like

... AND COUNT (SELECT * FROM files WHERE dev = ? AND ino = ?) == 0;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68156</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-08 19:59:06 +0000</bug_when>
    <thetext>Will fixing this bring back the performance problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68158</commentid>
    <comment_count>3</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2016-11-08 20:40:25 +0000</bug_when>
    <thetext>I don&apos;t think so. The performance problem required a check of every dev/ino pair found in the xattrs table against the whole database, this would check only one.

I have this and a couple of other patches to look at. (Someone sent me a fix for Python3 compat. Yay.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68404</commentid>
    <comment_count>4</comment_count>
    <who name="Benjamin Esquivel">benjamin.esquivel</who>
    <bug_when>2016-11-17 15:45:02 +0000</bug_when>
    <thetext>if this bug is blocking the swupd progress, can the swupd bug be noted in the blockers of this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68409</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2016-11-17 15:57:34 +0000</bug_when>
    <thetext>This is not blocking meta-swupd progress because I am using a workaround (don&apos;t remove hardlinked files). Would be nicer to not have to carry that workaround, though.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70344</commentid>
    <comment_count>6</comment_count>
    <who name="Seebs">seebs</who>
    <bug_when>2017-02-01 18:37:56 +0000</bug_when>
    <thetext>I&apos;ve made a corresponding patch in upstream pseudo that appears to address this. It&apos;s a trivial couple-of-line patch. Although past-seebs said &quot;COUNT (SELECT...)&quot; which is of course wrong, it&apos;s &quot;SELECT COUNT(*)&quot;.

Anyway, checked in upstream, commit 02168305b0a19f981ffe857f36eb256ba8810b77.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70469</commentid>
    <comment_count>7</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-07 13:15:36 +0000</bug_when>
    <thetext>Once there&apos;s a tarball for the 1.8.2 release I&apos;ll take care of updating the recipe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70491</commentid>
    <comment_count>8</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-07 15:54:00 +0000</bug_when>
    <thetext>Richard generated the release tarball today, patch sent:

https://patchwork.openembedded.org/patch/136835/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70732</commentid>
    <comment_count>9</comment_count>
    <who name="Joshua Lock">joshuagloe</who>
    <bug_when>2017-02-16 10:49:06 +0000</bug_when>
    <thetext>Pseudo recipe upgraded in OE-Core/poky:
http://git.openembedded.org/openembedded-core/commit/?id=6437f14c9177fd7ec7a9b6bca873362b0c94abfb
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5ca7184552b35a80a0d78f06e2264502144c1faf</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>