<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:54: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-5757] hsm: userspace can set about any HSM flags. Checks are inexistant.</title>
                <link>https://jira.whamcloud.com/browse/LU-5757</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Creating, opening and executing the following commands on a regular file:&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;rc = llapi_hsm_state_set_fd(fd, HS_EXISTS, 0, -1789);
rc = llapi_hsm_state_set_fd(fd, HS_DIRTY, 0, 0);
rc = llapi_hsm_state_set_fd(fd, 0, HS_DIRTY, 0);
rc = llapi_hsm_state_set_fd(fd, HS_ARCHIVED, 0, 0);
rc = llapi_hsm_state_set_fd(fd, HS_RELEASED, 0, 0);
rc = llapi_hsm_state_set_fd(fd, HS_NORELEASE, 0, 0);
rc = llapi_hsm_state_set_fd(fd, HS_NOARCHIVE, 0, 0);
rc = llapi_hsm_state_set_fd(fd, HS_LOST, 0, 0);
rc = llapi_hsm_state_set_fd(fd, 0x00080000, 0, 0);
rc = llapi_hsm_state_set_fd(fd, 0x80000000, 0, 0);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;results in this:&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;# ../utils/lfs hsm_state /mnt/lustre/hsm_check_test
 /mnt/lustre/hsm_check_test: (0x8008007d) released exists archived never_release never_archive lost_from_hsm, archive_id:-1789
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Some of these flags should not be user settable. Unknown flags should not be set. The archive_id should not be anything but &amp;gt;=0 (or 1?) and &amp;lt;=32.&lt;/p&gt;
</description>
                <environment></environment>
        <key id="27051">LU-5757</key>
            <summary>hsm: userspace can set about any HSM flags. Checks are inexistant.</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</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="fzago">Frank Zago</reporter>
                        <labels>
                            <label>hsm</label>
                    </labels>
                <created>Thu, 16 Oct 2014 17:08:09 +0000</created>
                <updated>Thu, 9 Mar 2017 20:33:10 +0000</updated>
                            <resolved>Wed, 25 Mar 2015 17:09:52 +0000</resolved>
                                    <version>Lustre 2.7.0</version>
                    <version>Lustre 2.5.3</version>
                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="96597" author="adilger" created="Fri, 17 Oct 2014 17:16:47 +0000"  >&lt;p&gt;Just to confirm - this can only be done on files a user owns, or by root?  It definitely makes sense to add better checks for the HSM input (see also &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2714&quot; title=&quot;HSM: add sanity checks for incoming RPCs&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2714&quot;&gt;&lt;del&gt;LU-2714&lt;/del&gt;&lt;/a&gt;), so a general review of all such input would be welcome.&lt;/p&gt;</comment>
                            <comment id="96628" author="fzago" created="Fri, 17 Oct 2014 19:49:05 +0000"  >&lt;p&gt;This test was done as root.&lt;/p&gt;

&lt;p&gt;I checked with a user, and most of these commands are reject with -EPERM. I think that&apos;s wrong too because -EPERM should only be used when the user doesn&apos;t have the correct permissions on that file.&lt;/p&gt;</comment>
                            <comment id="96699" author="rread" created="Mon, 20 Oct 2014 15:24:24 +0000"  >&lt;p&gt;Why is archive_id limited to max 32?&lt;/p&gt;</comment>
                            <comment id="96702" author="rread" created="Mon, 20 Oct 2014 15:30:28 +0000"  >&lt;p&gt;I believe the LOST flag is intended to be set by userspace, since this reflects backend state that the kernel is unaware of.  It is also useful to be able to clear the flags from user space to allow a file to be moved to a different HSM archive backend. (Although it would be better to clear flags automatically when the archive_id is changed, though that would be a behavior change and might break something.)&lt;/p&gt;</comment>
                            <comment id="96717" author="fzago" created="Mon, 20 Oct 2014 16:29:04 +0000"  >&lt;p&gt;Robert,&lt;/p&gt;

&lt;p&gt;I think the 32 archive ids is a limitation of Lustre. lhsmtool_posix.c has this:&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;     60 /* copytool uses a 32b bitmask field to register with kuc
     61  * archive num = 0 =&amp;gt; all
     62  * archive num from 1 to 32
     63  */
     64 #define MAX_ARCHIVE_CNT (sizeof(__u32) * 8)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
</comment>
                            <comment id="96727" author="rread" created="Mon, 20 Oct 2014 17:36:00 +0000"  >&lt;p&gt;Interesting. This appears to only be a limitation of the kuc interface.  If a copytool doesn&apos;t specify an archive id when it calls register (i.e. passes a 0), then it seems it can handle any archive id. &lt;/p&gt;</comment>
                            <comment id="96823" author="jcl" created="Tue, 21 Oct 2014 13:52:42 +0000"  >&lt;p&gt;I confirm this limit to 32 comes from kuc protocol/structures. Seeing the use cases, 32 looks ok and mainly all the site will have one backend archive system and so will always use the default (0 = all)&lt;/p&gt;</comment>
                            <comment id="99963" author="fzago" created="Mon, 24 Nov 2014 20:51:50 +0000"  >&lt;p&gt;Test for this case (test51): &lt;a href=&quot;http://review.whamcloud.com/12836/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/12836/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="103140" author="gerrit" created="Sat, 10 Jan 2015 11:35:40 +0000"  >&lt;p&gt;Faccini Bruno (bruno.faccini@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/13337&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13337&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5757&quot; title=&quot;hsm: userspace can set about any HSM flags. Checks are inexistant.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5757&quot;&gt;&lt;del&gt;LU-5757&lt;/del&gt;&lt;/a&gt; hsm: strengthen checks for flags and archive id&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 9379ce022fe908f3168987bfbc12214426f57fe8&lt;/p&gt;</comment>
                            <comment id="103145" author="bfaccini" created="Sat, 10 Jan 2015 22:32:52 +0000"  >&lt;p&gt;Just pushed master pach &lt;a href=&quot;http://review.whamcloud.com/13337&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13337&lt;/a&gt; which should allow for HSM flags and archive-id values to be checked.&lt;/p&gt;</comment>
                            <comment id="103210" author="fzago" created="Mon, 12 Jan 2015 18:17:33 +0000"  >&lt;p&gt;Thanks Bruno. I&apos;ve updated test test in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5757&quot; title=&quot;hsm: userspace can set about any HSM flags. Checks are inexistant.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5757&quot;&gt;&lt;del&gt;LU-5757&lt;/del&gt;&lt;/a&gt; (not pushed yet) and it&apos;s better.&lt;/p&gt;

&lt;p&gt;But should root even be allowed to set/unset the following flags:  HS_DIRTY, HS_ARCHIVED and HS_RELEASED?&lt;/p&gt;</comment>
                            <comment id="103755" author="fzago" created="Fri, 16 Jan 2015 16:25:50 +0000"  >&lt;p&gt;Patch to add since &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5732&quot; title=&quot;hsm: sanity check for sane progress extent value&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5732&quot;&gt;&lt;del&gt;LU-5732&lt;/del&gt;&lt;/a&gt; went upstream&lt;/p&gt;</comment>
                            <comment id="103820" author="bfaccini" created="Sat, 17 Jan 2015 14:29:22 +0000"  >&lt;p&gt;Thanks to warn me (and to provide your add-on proposal) about the fact that some of your new tests in your patch for &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5732&quot; title=&quot;hsm: sanity check for sane progress extent value&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5732&quot;&gt;&lt;del&gt;LU-5732&lt;/del&gt;&lt;/a&gt; will fail. I don&apos;t know why but I was wrongly assuming that you had already anticipated the final/expected behavior and error returns from this patch in your new tests ... BTW, since I was planning to either run your new tests against this patch, or apply/relate mine on top of your or now that yours has been integrated to rebase mine, hopefully auto-tests would have also warned me!&lt;/p&gt;

&lt;p&gt;Concerning your remark about root being or not allowed to set/unset HS_DIRTY, HS_ARCHIVED and HS_RELEASED, my feeling is that yes it should be allowed, mainly to help fixing unusual/inconsistent situations. But this can be discussed!&lt;/p&gt;</comment>
                            <comment id="103862" author="rread" created="Mon, 19 Jan 2015 16:58:22 +0000"  >&lt;p&gt;I agree there are use cases for manually setting HS_DIRTY and  HS_ARCHIVED, but just setting the HS_RELEASED flag is not enough to really make a file &quot;released&quot;.  The layout also needs to changed, and I don&apos;t see a way to do that directly.  However, if one can clear HS_DIRTY and manually set HS_ARCHIVED,  then in theory the HUA_RELEASE request should properly mark the file as released.  If the file is somehow corrupted then it&apos;s also possible to use llapi_hsm_import() to recreate the released file. &lt;/p&gt;</comment>
                            <comment id="103994" author="bfaccini" created="Tue, 20 Jan 2015 14:50:22 +0000"  >&lt;p&gt;Robert, thanks to detail this. And Yes, using the import feature along with manual flags setting was some of the repair actions I thought about to be helpful in some cases.&lt;/p&gt;</comment>
                            <comment id="110612" author="gerrit" created="Wed, 25 Mar 2015 14:41:14 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/13337/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/13337/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5757&quot; title=&quot;hsm: userspace can set about any HSM flags. Checks are inexistant.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5757&quot;&gt;&lt;del&gt;LU-5757&lt;/del&gt;&lt;/a&gt; hsm: strengthen checks for flags and archive id&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 32bd5051a518c57e35f51b7f3c7f739b5ef91b25&lt;/p&gt;</comment>
                            <comment id="110630" author="pjones" created="Wed, 25 Mar 2015 17:09:52 +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">
                                        <issuelink>
            <issuekey id="29475">LU-6453</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="16710" name="5732-llapi-hsm-test2.diff" size="1462" author="fzago" created="Fri, 16 Jan 2015 16:25:50 +0000"/>
                    </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|hzwyqn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16155</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>