<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:58:15 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-6214] HSM released files archive with &apos;tar --xattr -c&apos; cannot be extracted to lustre</title>
                <link>https://jira.whamcloud.com/browse/LU-6214</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# echo XXX &amp;gt; f0
# lfs hsm_archive f0
# lfs hsm_state f0
f0: (0x00000009) exists archived, archive_id:1
# lfs hsm_release f0
# lfs hsm_state f0
f0: (0x0000000d) released exists archived, archive_id:1
# tar --xattr -cf /tmp/f0.tar f0
tar: f0: file changed as we read it
# rm f0
# tar --xattr -xf /tmp/f0.tar f0
tar: f0: Cannot write: No data available
tar: Exiting with failure status due to previous errors
# echo $?
2
# ls
f0
# cat f0
cat: f0: No data available
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It does not matter if --xattr is used during extraction.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# rm f0
# tar -xf /tmp/f0.tar f0
tar: f0: Cannot write: No data available
tar: Exiting with failure status due to previous errors
# ls
f0
# cat f0
cat: f0: No data available
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Extraction is creating the file and giving it a trusted.lov xattr which has a released pattern. From strace:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;mknod(&quot;f0&quot;, 0600)                       = 0
setxattr(&quot;f0&quot;, &quot;trusted.hsm&quot;, &quot;\x00\x00\x00\x00\x0d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0
0\x00\x15\x00\x00\x00\x01\x00\x00\x00&quot;, 24, 0) = 0
setxattr(&quot;f0&quot;, &quot;trusted.link&quot;, &quot;\xdf\xf1\xea\x11\x01\x00\x00\x00,\x00\x00\x00\x00\x00\x00\
x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x0
1\x00\x00\x00\x00f0&quot;, 44, 0) = 0
setxattr(&quot;f0&quot;, &quot;trusted.lov&quot;, &quot;\xd0\x0b\xd1\x0b\x01\x00\x00\x80\x0f\x00\x00\x00\x00\x00\x0
0\x00\x00\x04\x00\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00&quot;, 32, 0) = 0
setxattr(&quot;f0&quot;, &quot;trusted.lma&quot;, &quot;\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x02\x00\x0
0\x00\x0f\x00\x00\x00\x00\x00\x00\x00&quot;, 24, 0) = 0
open(&quot;f0&quot;, O_WRONLY|O_CREAT, 0600)      = 4
write(4, &quot;XXX\n&quot;, 4)                    = -1 ENODATA (No data available)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# lfs getstripe f0
f0
lmm_stripe_count:   1
lmm_stripe_size:    1048576
lmm_pattern:        80000001
lmm_layout_gen:     0
lmm_stripe_offset:  0
# getfattr -d -m- f0
# file: f0
trusted.link=0s3/HqEQEAAAAsAAAAAAAAAAAAAAAAAAAAABQAAAACAAAABwAAAAEAAAAAZjA=
trusted.lma=0sAAAAAAAAAAAABAAAAgAAABcAAAAAAAAA
trusted.lov=0s0AvRCwEAAIAXAAAAAAAAAAAEAAACAAAAAAAQAAAAAAA=
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The same archive works fine when extracting to an ext4 filesystem.&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;# cd /tmp
# tar -xf /tmp/f0.tar f0
# cat f0
XXX
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="28574">LU-6214</key>
            <summary>HSM released files archive with &apos;tar --xattr -c&apos; cannot be extracted to lustre</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="1">Fixed</resolution>
                                        <assignee username="bfaccini">Bruno Faccini</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>hsm</label>
                            <label>lov</label>
                            <label>patch</label>
                            <label>tar</label>
                    </labels>
                <created>Thu, 5 Feb 2015 16:56:17 +0000</created>
                <updated>Wed, 23 Sep 2015 13:07:39 +0000</updated>
                            <resolved>Wed, 23 Sep 2015 13:07:39 +0000</resolved>
                                    <version>Lustre 2.7.0</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>13</watches>
                                                                            <comments>
                            <comment id="105889" author="adilger" created="Thu, 5 Feb 2015 18:31:50 +0000"  >&lt;p&gt;It probably doesn&apos;t make sense to expose the RELEASED flag to userspace in this way. I&apos;d think that we want the userspace visible attributes of the file to remain unchanged regardless of whether the file is archived or not.&lt;/p&gt;

&lt;p&gt;Should we just mask off the RELEASED flag before returning &lt;tt&gt;lustre.lov&lt;/tt&gt; to userspace? Should that layout also inherit the default striping from the parent (&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6211&quot; title=&quot;getxattr() for {lustre,trusted}.lov on HSM released file returns stripe count 0&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6211&quot;&gt;LU-6211&lt;/a&gt;)?&lt;/p&gt;</comment>
                            <comment id="108068" author="panditadityashreesh" created="Thu, 26 Feb 2015 07:57:04 +0000"  >&lt;p&gt;I did the following analysis:&lt;br/&gt;
1. Execute the lfs hsm_archive filename. This executes ioctl.&lt;br/&gt;
2. The ioctl triggers the copytool an up call driver&lt;br/&gt;
3. Went through the copytool  in lustre/utils/lhsmtool_posix.c&lt;br/&gt;
4. ct_save_stripe and other fuction uses fgetxattr function to retrive the lov_user_md buffer. This buffer contains magic number, pattern, object id, size of stripe, number of stripes offset, layout generation number and unsized array of ost data object.&lt;br/&gt;
5. When hsm_release is called it release the space and only keep pointers.&lt;br/&gt;
6. The file is archived using normal tar with --xattr it calls fgetxattr which save the xattrs. but note that it would not store the stripe information of data objects.&lt;br/&gt;
7. Now in the test case the file is deleted using the lmv_unlink -&amp;gt; ll_unlink -&amp;gt; md_unlink -&amp;gt; mdo_unlink  call.&lt;br/&gt;
8. Now we have tar file with corrupted xattrs data which we would like to restore using tar --xattrs -xf file.tar file. This tries to apply the layout map and fails.The file is present in the archive.&lt;br/&gt;
9. If you perform same operation without --xattr it works perfectly fine.&lt;br/&gt;
10. If file is archived, released, tar, restore, untar it does not work because same problem comes while restoring the attributes.&lt;br/&gt;
11. If file is tarred before the release operation it works.&lt;br/&gt;
12. Might be tar is not enabled to read the striping information from file that is already released. &lt;/p&gt;</comment>
                            <comment id="109735" author="gerrit" created="Mon, 16 Mar 2015 07:51:54 +0000"  >&lt;p&gt;Aditya Pandit (aditya.pandit@clogeny.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/14086&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/14086&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6214&quot; title=&quot;HSM released files archive with &amp;#39;tar --xattr -c&amp;#39; cannot be extracted to lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6214&quot;&gt;&lt;del&gt;LU-6214&lt;/del&gt;&lt;/a&gt;: ignore hsm special xattr for now&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: b2_5&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 290f638056fc17613b2028b521933eb1f5c86259&lt;/p&gt;</comment>
                            <comment id="111480" author="panditadityashreesh" created="Fri, 3 Apr 2015 11:01:29 +0000"  >&lt;p&gt;I looked more closely at the bug and the flow. flow goes like this&lt;br/&gt;
tar -&amp;gt; listxattr -&amp;gt; getxattr. Then while restoring using tar, it has all the xattrs with incorrect parameters where it calls create -&amp;gt; setxattr. Here it tries to set the stripe information. I think ideally tar should not be allowed to manipulate the internal structures of lustre because it is not fully aware of lustre. &lt;br/&gt;
lustre manipulates the stripe information in ll_setxattr and also exposes attributes in listxattr, getxattr and setxattr. &lt;/p&gt;

&lt;p&gt;How about we separate extended attributes manipulated by lustre and those that use getxattr/setxattr? Put the implementation of manipulation of setxattr/getxattr as ioctls. lhsmtool_posix would call the ioctl for manipulating the attributes. &lt;/p&gt;

&lt;p&gt;We can completely filter out the lustre specific attributes in getxattr and setxattr, so that applications like tar would not manipulate lustre specific attributes at all. It would be a normal read,write,getxattr and setxattr operation for tar or any other application that manipulate the xattr. Such applications would only handle the attributes which they have set and not the xattrs of lustre.&lt;/p&gt;
</comment>
                            <comment id="111536" author="adilger" created="Sat, 4 Apr 2015 13:24:56 +0000"  >&lt;p&gt;Being able to backip and restore the stripe parameters with tar is a feature that users asked for. I think the right solution here is to just mask out the &quot;RELEASED&quot; flag from the &quot;lov&quot; xattr when it is set. That avoids the current problem of the new file being marked released when it is being restored, but keeps the ability to backup and restore the file layout. It also makes sense to ignore the HSM xattr as the existing patch 14086 does, but it needs updating as mentioned in the comments there. Also, patches should be submitted to master first. &lt;/p&gt;</comment>
                            <comment id="124871" author="gerrit" created="Mon, 24 Aug 2015 11:15:42 +0000"  >&lt;p&gt;Aditya Pandit (panditadityashreesh@yahoo.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/16060&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/16060&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6214&quot; title=&quot;HSM released files archive with &amp;#39;tar --xattr -c&amp;#39; cannot be extracted to lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6214&quot;&gt;&lt;del&gt;LU-6214&lt;/del&gt;&lt;/a&gt; llite: HSM released files archive.&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a2af454aeb1d501647be4de127ebaf945de7e721&lt;/p&gt;</comment>
                            <comment id="124994" author="bfaccini" created="Tue, 25 Aug 2015 09:24:42 +0000"  >&lt;p&gt;Don&apos;t forget to abandon #14086.&lt;/p&gt;</comment>
                            <comment id="128184" author="gerrit" created="Tue, 22 Sep 2015 23:23:13 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/16060/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/16060/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-6214&quot; title=&quot;HSM released files archive with &amp;#39;tar --xattr -c&amp;#39; cannot be extracted to lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-6214&quot;&gt;&lt;del&gt;LU-6214&lt;/del&gt;&lt;/a&gt; llite: tar restore fails for HSM released files.&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: b567f5066b7ca2d15d4f492ec205651c9a63ef98&lt;/p&gt;</comment>
                            <comment id="128231" author="pjones" created="Wed, 23 Sep 2015 13:07:39 +0000"  >&lt;p&gt;Landed for 2.8&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hzx5r3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>17384</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>