<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:58:31 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-6243] version liblustreapi.so</title>
                <link>https://jira.whamcloud.com/browse/LU-6243</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Ran into a problem that uncovers a potentially catastrophic issue.&lt;/p&gt;

&lt;p&gt;The patch &lt;a href=&quot;http://review.whamcloud.com/10393&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/10393&lt;/a&gt; made some non-backward-compatible changes to the liblustreapi interface. The offending changes are:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;-extern &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; libcfs_ukuc_start(lustre_kernelcomm *l, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; groups);
+extern &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; libcfs_ukuc_start(lustre_kernelcomm *l, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; groups, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; rfd_flags);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt; extern &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; llapi_hsm_copytool_register(struct hsm_copytool_private **priv,
-                                      &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *mnt, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; flags,
-                                      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; archive_count, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; *archives);
+                                      &lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *mnt, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; archive_count,
+                                      &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; *archives, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; rfd_flags);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The second change is most serious, since it is rearranging the arguments for the function &lt;tt&gt;llapi_hsm_copytool_register()&lt;/tt&gt; for no particularly good reason.&lt;/p&gt;

&lt;p&gt;Running an OLD copytool linked against the old liblustreapi.so (Lustre 2.5.2 or earlier) with the NEW liblustreapi.so dynamic library (Lustre 2.5.3+ or Lustre 2.6.0+) exposes this problem. Because all of the required symbol references were found in the library, the linking was successful, so the function llapi_hsm_copytool_register() was called WITH BAD ARGUMENTS.&lt;/p&gt;

&lt;p&gt;In this case, the result was harmless &amp;#8211; the registration call simply failed. However, it&apos;s easy to imagine scenarios where swapping arguments could result in wiping out critical user data &amp;#8211; switching the length and offset in a write operation, for instance. At the very best, this results in problems that are difficult to diagnose as in this case.&lt;/p&gt;

&lt;p&gt;It appears that &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; landed a series of API check in lustre/tests/llapi_hsm_test.c, but this was only landed for Lustre 2.6.93 so the API change was unnoticed.&lt;/p&gt;

&lt;p&gt;To allow changes like this to happen safely in the future there needs to be a version in the lib*.so files. There are basically two ways to do this:&lt;/p&gt;

&lt;p&gt;1) Least burden on developer, but inconveniences users:&lt;/p&gt;

&lt;p&gt;When you create the library, you use:&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;gcc -o liblustreapi.so.1 -Wl,soname,liblustreapi.so.1 ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This creates a file named liblustreapi.so.1, with a dynamic linker name of liblustreapi.so.1. The application is compiled against liblustreapi.so.1, and will find the file liblustreapi.so.1 containing the correct linker references.&lt;/p&gt;

&lt;p&gt;Library fixes that are fully backward-compatible simply &quot;update&quot; the old liblustreapi.so.1 by overwriting it. The burden on the library provider is merely to ensure that all changes are, in fact, backward-compatible.&lt;/p&gt;

&lt;p&gt;When you change the API in a non-backward-compatible way (as in this case), you roll the version number:&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;gcc -o liblustreapi.so.2 -Wl,soname,liblustreapi.so.2 ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The OLD application will no longer be able to resolve references to liblustreapi.so.1, and fails with a link error, which is easy to diagnose. The NEW application will link with liblustreapi.so.2, and will work properly using the new syntax and the new dynamic library.&lt;/p&gt;

&lt;p&gt;The downside of this is that users need time to adapt to the incompatible changes in the API, and could be without any workable solution until that is finished.  It also prevents the same binary from working on different versions of Lustre, which is the whole intent of liblustreapi.&lt;/p&gt;

&lt;p&gt;2) More flexible solution&lt;/p&gt;

&lt;p&gt;In this case, when you introduce an non-backward-compatible change to the library, you release TWO new libraries:&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;gcc -o liblustreapi.so.1 -Wl,soname,liblustreapi.so.1 ...
gcc -o liblustreapi.so.2 -Wl,soname,liblustreapi.so.2 ...
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The installation overwrites the old library, and adds the new library.&lt;/p&gt;

&lt;p&gt;You must guarantee strict backward-compatibility in the latest 1 version (preserving syntax and functionality), and you provide the new API in the 2 version. Both work, so the OLD application (compiled against liblustreapi.so.1) and the NEW application (compiled against liblustreapi.so.2) both work.&lt;/p&gt;

&lt;p&gt;If application is using the old API, or chooses to not move forward until the new library is thoroughly tested, or encounters a difficult problem with the new code, they can continue to compile against the old headers and liblustreapi.so.1 until all issues are resolved, and the user is not left without a solution.&lt;/p&gt;

&lt;p&gt;Version 1 is now in a deprecated state, and can eventually be obsoleted and removed in the RPM %post scriptlet.&lt;/p&gt;

&lt;p&gt;This ensures continuity for the user and less pressure on the users.&lt;/p&gt;

&lt;p&gt;=================&lt;br/&gt;
Suggested solution:&lt;/p&gt;

&lt;p&gt;Please implement 1) at the very least to prevent user behavior from creating a disaster. To summarize:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Append a version number to liblustreapi.so.&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;Roll the version number forward any time non-backward-compatible changes to the API are introduced.&lt;/li&gt;
&lt;/ol&gt;


&lt;ol&gt;
	&lt;li&gt;Add a %post scriptlet to the API to remove old versions of liblustreapi.so&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;This may open a gap where the customer will be unable to run after upgrading Lustre, but it will at least prevent catastrophic problems.&lt;/p&gt;

&lt;p&gt;solution 2) above is probably the best in the long term. It is a bit more work for the developer, but it greatly enhances the user experience. It also imposes a counter-incentive to making arbitrary minor changes to the API.&lt;/p&gt;</description>
                <environment></environment>
        <key id="28691">LU-6243</key>
            <summary>version liblustreapi.so</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="simmonsja">James A Simmons</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 12 Feb 2015 21:34:01 +0000</created>
                <updated>Mon, 31 Jan 2022 05:07:36 +0000</updated>
                            <resolved>Sun, 14 Jan 2018 17:29:56 +0000</resolved>
                                    <version>Lustre 2.6.0</version>
                    <version>Lustre 2.7.0</version>
                    <version>Lustre 2.5.3</version>
                                    <fixVersion>Lustre 2.11.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="106878" author="simmonsja" created="Thu, 12 Feb 2015 22:07:57 +0000"  >&lt;p&gt;Versioning of liblustreapi was done in the patch for &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5541&quot; title=&quot;improve liblustreapi build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5541&quot;&gt;&lt;del&gt;LU-5541&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="125068" author="adilger" created="Tue, 25 Aug 2015 18:07:13 +0000"  >&lt;p&gt;That is patch &lt;a href=&quot;http://review.whamcloud.com/11625&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/11625&lt;/a&gt; to build versioned liblustreapi libraries.&lt;/p&gt;</comment>
                            <comment id="206673" author="simmonsja" created="Mon, 28 Aug 2017 17:02:18 +0000"  >&lt;p&gt;With the landing of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5541&quot; title=&quot;improve liblustreapi build&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5541&quot;&gt;&lt;del&gt;LU-5541&lt;/del&gt;&lt;/a&gt; this work is completed&lt;/p&gt;</comment>
                            <comment id="210866" author="adilger" created="Wed, 11 Oct 2017 19:38:42 +0000"  >&lt;p&gt;This patch was reverted &lt;a href=&quot;https://review.whamcloud.com/28783&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/28783&lt;/a&gt; due to problems building on Ubuntu.&lt;/p&gt;</comment>
                            <comment id="218224" author="simmonsja" created="Sun, 14 Jan 2018 17:29:56 +0000"  >&lt;p&gt;Patch&#160;&lt;a href=&quot;https://review.whamcloud.com/#/c/30562/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/30562&lt;/a&gt;&#160;resolved this. Note liblustreapi.so now have versions so please update the library version when new features are added.&lt;/p&gt;</comment>
                            <comment id="218229" author="adilger" created="Sun, 14 Jan 2018 19:32:22 +0000"  >&lt;p&gt;James, what is the current library version number, and how does one update it?&lt;/p&gt;</comment>
                            <comment id="218232" author="simmonsja" created="Sun, 14 Jan 2018 21:14:00 +0000"  >&lt;p&gt;In lustre/utils/Makefile.am you see:&lt;/p&gt;

&lt;p&gt;liblustreapi_la_LDFLAGS = $(LIBREADLINE) -version-info 1:0:0&lt;/p&gt;

&lt;p&gt;version-info controls the library version. Yeah I picked 1.0.0 which might not be the best value.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="26142">LU-5541</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="18174">LU-3074</issuekey>
        </issuelink>
                            </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|hzx6an:</customfieldvalue>

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