<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:26:50 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-9512] Implement O_TMPFILE for Lustre</title>
                <link>https://jira.whamcloud.com/browse/LU-9512</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;We should implement O_TMPFILE for Lustre. We already have a similar interface for creating volatile files for &lt;tt&gt;lfs_migrate()&lt;/tt&gt;. This should be hooked into the VFS O_TMPFILE mechanism for applications to use.&lt;/p&gt;

&lt;p&gt;From the &lt;tt&gt;open(2)&lt;/tt&gt; man page in RHEL8.5:&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;       O_TMPFILE (since Linux 3.11)
              Create an unnamed temporary regular file.  The pathname argument
              specifies a directory; an unnamed inode will be created in that
              directory&apos;s filesystem.  Anything written to the resulting file
              will be lost when the last file descriptor is closed, unless the
              file is given a name.

              O_TMPFILE must be specified with one of O_RDWR or O_WRONLY  and,
              optionally, O_EXCL.  If O_EXCL is not specified, then linkat(2)
              can be used to link the temporary file into the filesystem,
              making it permanent, using code like the following:

                  char path[PATH_MAX];
                  fd = open(&quot;/path/to/dir&quot;, O_TMPFILE | O_RDWR,
                                            S_IRUSR | S_IWUSR);

                  /* File I/O on &apos;fd&apos;... */

                  snprintf(path, PATH_MAX, &quot;/proc/self/fd/%d&quot;, fd);
                  linkat(AT_FDCWD, path, AT_FDCWD, &quot;/path/for/file&quot;,
                         AT_SYMLINK_FOLLOW);

              In this case, the open() mode argument determines the file
              permission mode, as with O_CREAT.

              Specifying O_EXCL in conjunction with O_TMPFILE prevents a temporary
              file from being linked into the filesystem in the above manner.
              (Note that the meaning of O_EXCL in this case is different from
              the meaning of O_EXCL otherwise.)

              There are two main use cases for O_TMPFILE:

              *  Improved tmpfile(3) functionality: race-free creation of
                 temporary files that (1) are automatically deleted when closed;
                 (2) can never be reached via any pathname; (3) are not subject
                 to symlink attacks; and (4) do not require the caller to devise
                 unique names.

              *  Creating a file that is initially invisible, which is then
                 populated with data and adjusted to have appropriate filesystem
                 attributes (fchown(2), fchmod(2), fsetxattr(2), etc.) before
                 being atomically linked into the filesystem in a fully formed
                 state (using linkat(2) as described above).

              O_TMPFILE requires support by the underlying filesystem; only a
              subset of Linux filesystems provide that support.  In the initial
              implementation, support was provided in the ext2, ext3, ext4,
              UDF, Minix, and shmem filesystems.  Support for other filesystems
  &#160; &#160; &#160; &#160; &#160; &#160; has subsequently been added as follows: XFS (Linux 3.15); Btrfs
              (Linux 3.16); F2FS (Linux 3.16); and ubifs (Linux 4.9)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="46121">LU-9512</key>
            <summary>Implement O_TMPFILE for Lustre</summary>
                <type id="2" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11311&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="arshad512">Arshad Hussain</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>lug23dd</label>
                            <label>medium</label>
                    </labels>
                <created>Tue, 16 May 2017 14:57:05 +0000</created>
                <updated>Fri, 5 May 2023 17:38:50 +0000</updated>
                                            <version>Upstream</version>
                    <version>Lustre 2.11.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>8</watches>
                                                                            <comments>
                            <comment id="243945" author="nrutman" created="Thu, 14 Mar 2019 18:46:53 +0000"  >&lt;p&gt;+1&lt;/p&gt;

&lt;p&gt;The MDS could give each client some number of FIDs to use for these temp files, along with algorithmic layouts, to move the MDS entirely out of the create path&lt;/p&gt;</comment>
                            <comment id="243989" author="adilger" created="Fri, 15 Mar 2019 11:30:52 +0000"  >&lt;p&gt;Each client already has a preallocated range of FIDs (two SEQ values, which they typically each use for 128k creates). The real problem is that the client can&apos;t &quot;open&quot; a file without contacting the MDS, since it won&apos;t have an inode allocated, and if a client allocated lots of O_TMPFILE files and then tried to write them later it may run out of space. &lt;/p&gt;

&lt;p&gt;Doing something like Oleg&apos;s Write Back Cache would allow the inode to be opened in the client RAM. &lt;/p&gt;</comment>
                            <comment id="346109" author="nrutman" created="Thu, 8 Sep 2022 21:37:03 +0000"  >&lt;p&gt;Just found this again. This sure is an ugly hack&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;
		rc = snprintf(volatile_file, sizeof(volatile_file),
			      &lt;span class=&quot;code-quote&quot;&gt;&quot;%s/%s:%.4X:%.4X:fd=%.2d&quot;&lt;/span&gt;, parent,
			      LUSTRE_VOLATILE_HDR, mdt_index,
			      random_value, fd);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="346113" author="adilger" created="Thu, 8 Sep 2022 22:09:30 +0000"  >&lt;p&gt;Definitely a hack:&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;
/* lustre &lt;span class=&quot;code-keyword&quot;&gt;volatile&lt;/span&gt; file support
 * file name header: .^L^S^T^R:&lt;span class=&quot;code-keyword&quot;&gt;volatile&lt;/span&gt;&quot;
 */
#define LUSTRE_VOLATILE_HDR    &lt;span class=&quot;code-quote&quot;&gt;&quot;.\x0c\x13\x14\x12:VOLATILE&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but still much less bad than &quot;silly rename&quot; for NFS.&lt;/p&gt;

&lt;p&gt;I don&apos;t think it would be hard to internally map files created with the VFS &lt;tt&gt;O_TMPFILE&lt;/tt&gt; onto &lt;tt&gt;LUSTRE_VOLATILE_HDR&lt;/tt&gt;. It would lose the ability of directly selecting which MDT the file was created on (so quite sub-optimal for striped directories if the temp file is linked into the directory later), but it should be OK for normal usage since a &quot;&lt;tt&gt;pathname&lt;/tt&gt;&quot; (parent directory) is specified and this could be used to determine the parent MDT.&lt;/p&gt;</comment>
                            <comment id="371065" author="adilger" created="Mon, 1 May 2023 17:56:29 +0000"  >&lt;p&gt;Assign to Arshad after discussion at LUG&apos;23 Developer Day.&lt;/p&gt;</comment>
                            <comment id="371416" author="gerrit" created="Fri, 5 May 2023 17:38:50 +0000"  >&lt;p&gt;&quot;Arshad Hussain &amp;lt;arshad.hussain@aeoncomputing.com&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/50871&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/50871&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-9512&quot; title=&quot;Implement O_TMPFILE for Lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-9512&quot;&gt;LU-9512&lt;/a&gt; utils: O_TMPFILE support&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: 49dca55a6587d11872794c9f5b3605122b37b713&lt;/p&gt;</comment>
                    </comments>
                    <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|hzzcvz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>