<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:53:47 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-5704] lfs getstripe hangs on fifo files</title>
                <link>https://jira.whamcloud.com/browse/LU-5704</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;lfs getstripe on fifo files hangs on &apos;open&apos; system call. This worked in 2.1.x version.&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;mhanafi@pfe23:/nobackupp8/mhanafi&amp;gt; rm testfifo
mhanafi@pfe23:/nobackupp8/mhanafi&amp;gt; mkfifo testfifo
mhanafi@pfe23:/nobackupp8/mhanafi&amp;gt; strace lfs getstripe testfifo
execve(&quot;/usr/bin/lfs&quot;, [&quot;lfs&quot;, &quot;getstripe&quot;, &quot;testfifo&quot;], [/* 35 vars */]) = 0
brk(0)                                  = 0x6c1000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fffedb02000
access(&quot;/etc/ld.so.preload&quot;, R_OK)      = -1 ENOENT (No such file or directory)
open(&quot;/etc/ld.so.cache&quot;, O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=270183, ...}) = 0
mmap(NULL, 270183, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fffedac0000
close(3)                                = 0
open(&quot;/lib64/libpthread.so.0&quot;, O_RDONLY) = 3
read(3, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0\200Z\0\0\0\0\0\0&quot;..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=135764, ...}) = 0
mmap(NULL, 2212784, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fffed6c9000
fadvise64(3, 0, 2212784, POSIX_FADV_WILLNEED) = 0
mprotect(0x7fffed6e0000, 2097152, PROT_NONE) = 0
mmap(0x7fffed8e0000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7fffed8e0000
mmap(0x7fffed8e2000, 13232, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fffed8e2000
close(3)                                = 0
open(&quot;/lib64/libc.so.6&quot;, O_RDONLY)      = 3
read(3, &quot;\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0&amp;gt;\0\1\0\0\0P\355\1\0\0\0\0\0&quot;..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1775524, ...}) = 0
mmap(NULL, 3639480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fffed350000
fadvise64(3, 0, 3639480, POSIX_FADV_WILLNEED) = 0
mprotect(0x7fffed4c0000, 2093056, PROT_NONE) = 0
mmap(0x7fffed6bf000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16f000) = 0x7fffed6bf000
mmap(0x7fffed6c4000, 18616, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fffed6c4000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fffedabf000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fffedabe000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fffedabd000
arch_prctl(ARCH_SET_FS, 0x7fffedabe700) = 0
mprotect(0x7fffed6bf000, 16384, PROT_READ) = 0
mprotect(0x7fffed8e0000, 4096, PROT_READ) = 0
mprotect(0x66a000, 4096, PROT_READ)     = 0
mprotect(0x7fffedb04000, 4096, PROT_READ) = 0
munmap(0x7fffedac0000, 270183)          = 0
set_tid_address(0x7fffedabe9d0)         = 61077
set_robust_list(0x7fffedabe9e0, 0x18)   = 0
futex(0x7fffffffe7dc, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fffffffe7dc, 0x189 /* FUTEX_??? */, 1, NULL, 7fffedabe700) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x7fffed6ce8f0, [], SA_RESTORER|SA_SIGINFO, 0x7fffed6d8810}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7fffed6ce980, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7fffed6d8810}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=300000*1024, rlim_max=7340032*1024}) = 0
shmget(IPC_PRIVATE, 65680, 0600)        = 438992901
shmat(438992901, 0, 0)                  = ?
shmctl(438992901, IPC_RMID, 0)          = 0
brk(0)                                  = 0x6c1000
brk(0x6e2000)                           = 0x6e2000
open(&quot;testfifo&quot;, O_RDONLY^
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="26836">LU-5704</key>
            <summary>lfs getstripe hangs on fifo files</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="bogl">Bob Glossman</assignee>
                                    <reporter username="mhanafi">Mahmoud Hanafi</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Oct 2014 21:56:35 +0000</created>
                <updated>Fri, 16 Sep 2016 23:37:07 +0000</updated>
                            <resolved>Sat, 2 Apr 2016 13:06:04 +0000</resolved>
                                    <version>Lustre 2.4.3</version>
                                    <fixVersion>Lustre 2.9.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>10</watches>
                                                                            <comments>
                            <comment id="95634" author="pjones" created="Fri, 3 Oct 2014 15:20:12 +0000"  >&lt;p&gt;Bob is trying to repro this issue&lt;/p&gt;</comment>
                            <comment id="95659" author="bogl" created="Fri, 3 Oct 2014 19:38:53 +0000"  >&lt;p&gt;This reproduces 100% in every version I have easy access to up through current master.&lt;/p&gt;

&lt;p&gt;I think this is expected behavior.  It behaves the same way if the test fifo file is in a lustre filesystem or not.  Looking at the kernel stack trace in crash shows that it is waiting in pipe_wait() in the kernel:&lt;/p&gt;

&lt;p&gt;PID: 110276  TASK: ffff88003a7b4300  CPU: 0   COMMAND: &quot;lfs&quot;&lt;br/&gt;
 #0 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747b48&amp;#93;&lt;/span&gt; schedule at ffffffff81461beb&lt;br/&gt;
 #1 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747c90&amp;#93;&lt;/span&gt; pipe_wait at ffffffff81164252&lt;br/&gt;
 #2 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747ce0&amp;#93;&lt;/span&gt; fifo_open at ffffffff8116f4d6&lt;br/&gt;
 #3 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747d10&amp;#93;&lt;/span&gt; __dentry_open at ffffffff81158f68&lt;br/&gt;
 #4 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747d60&amp;#93;&lt;/span&gt; do_last at ffffffff811685c2&lt;br/&gt;
 #5 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747dc0&amp;#93;&lt;/span&gt; path_openat at ffffffff81169839&lt;br/&gt;
 #6 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747e50&amp;#93;&lt;/span&gt; do_filp_open at ffffffff81169cbc&lt;br/&gt;
 #7 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747f20&amp;#93;&lt;/span&gt; do_sys_open at ffffffff8115a90f&lt;br/&gt;
 #8 &lt;span class=&quot;error&quot;&gt;&amp;#91;ffff88003a747f80&amp;#93;&lt;/span&gt; system_call_fastpath at ffffffff8146bd12&lt;br/&gt;
    RIP: 00007f7848bb0fd0  RSP: 00007fff3f449fd8  RFLAGS: 00010206&lt;br/&gt;
    RAX: 0000000000000002  RBX: ffffffff8146bd12  RCX: 6f66696674736574&lt;br/&gt;
    RDX: 0000000000000050  RSI: 0000000000000000  RDI: 0000000000624030&lt;br/&gt;
    RBP: 000000000040fde0   R8: 00007fff3f44c447   R9: 0000000000000000&lt;br/&gt;
    R10: 00007fff3f449d80  R11: 0000000000000246  R12: 000000000040a320&lt;br/&gt;
    R13: 00007fff3f44a070  R14: 0000000000624030  R15: 00007fff3f44a000&lt;br/&gt;
    ORIG_RAX: 0000000000000002  CS: 0033  SS: 002b&lt;/p&gt;

&lt;p&gt;I think it&apos;s normal behavior for a process that opens a fifo for read to just wait until somebody writes.   I note if I echo a few chars into the test fifo file the lfs command wakes up and says:&lt;/p&gt;

&lt;p&gt;error: can&apos;t get lov name.: Invalid argument (22)&lt;br/&gt;
testfifo has no stripe info&lt;/p&gt;

&lt;p&gt;then exits.&lt;/p&gt;

&lt;p&gt;I can&apos;t say why this ever worked in 2.1 unless the lfs code there somehow avoided doing an open on the file.&lt;/p&gt;</comment>
                            <comment id="145186" author="kolano" created="Thu, 10 Mar 2016 21:47:04 +0000"  >&lt;p&gt;Regardless of whether this ever worked, it&apos;s still a bug.  This isn&apos;t &quot;normal behavior&quot; of any command that gets file attributes.  I can do a stat on a fifo without hanging.  I can do a getfattr on a fifo without hanging.  I can do a getfacl on a fifo without hanging.  Getting stripe info is no different than these.  The implementation is flawed if it hangs and could be easily fixed with a fifo check that immediately prints the exact message shown after writing to the pipe.  I can&apos;t imagine the fix would take more than a few minutes?!?&lt;/p&gt;</comment>
                            <comment id="145193" author="bogl" created="Thu, 10 Mar 2016 22:41:33 +0000"  >&lt;p&gt;the fact that getfattr/getfacl/stat on a fifo don&apos;t hang isn&apos;t relevant IMHO.  you can do all those on a fifo in lustre too.&lt;/p&gt;

&lt;p&gt;lfs is a lustre specific tool.  it does open on it&apos;s target(s) prior to doing anything else.  I strongly disagree that it&apos;s a bug for it to hang in certain unlikely situations, like for instance trying to do lustre related stripe operations on files where that concept doesn&apos;t apply.  a read of a fifo that nobody ever writes to will hang in precisely the same way.&lt;/p&gt;
</comment>
                            <comment id="146152" author="adilger" created="Fri, 18 Mar 2016 17:47:08 +0000"  >&lt;p&gt;The reason that those other tools do not hang when opening a FIFO is because they pass open flags to prevent this.&lt;/p&gt;

&lt;p&gt;It appears that our &lt;tt&gt;open()&lt;/tt&gt; call in &lt;tt&gt;llapi_file_get_stripe()&lt;/tt&gt; is only passing &lt;tt&gt;O_RDONLY&lt;/tt&gt; and it should also include &lt;tt&gt;O_NONBLOCK&lt;/tt&gt; to avoid exactly this problem.&lt;/p&gt;</comment>
                            <comment id="146279" author="bogl" created="Mon, 21 Mar 2016 00:14:05 +0000"  >&lt;p&gt;&apos;lfs getstripe&apos; doesn&apos;t call llapi_file_get_stripe() at all.  It does however do a different call sequence that has an open() call with only O_RDONLY in the flags.&lt;/p&gt;

&lt;p&gt;I can work up a patch to add O_NONBLOCK, but this particular call sequence is used for so many other things too I&apos;m worried that doing so will cause bad side effects.&lt;/p&gt;</comment>
                            <comment id="146310" author="gerrit" created="Mon, 21 Mar 2016 13:32:52 +0000"  >&lt;p&gt;Bob Glossman (bob.glossman@intel.com) uploaded a new patch: &lt;a href=&quot;http://review.whamcloud.com/19039&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/19039&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5704&quot; title=&quot;lfs getstripe hangs on fifo files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5704&quot;&gt;&lt;del&gt;LU-5704&lt;/del&gt;&lt;/a&gt; utils: stop open hangs on fifo files&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: bbb6139de7761d43a5b86e1ee14550d5f7ba2c02&lt;/p&gt;</comment>
                            <comment id="146660" author="jaylan" created="Wed, 23 Mar 2016 18:19:41 +0000"  >&lt;p&gt;Bob, if you are worried that this patch &quot;will cause bad side effects,&quot; we are not comfortable applying this patch to our production systems.&lt;/p&gt;</comment>
                            <comment id="146663" author="bogl" created="Wed, 23 Mar 2016 18:23:58 +0000"  >&lt;p&gt;Jay,&lt;br/&gt;
At this point I believe my worry was unfounded.   That comment was from before I created and submitted my patch.  It has since undergone a complete set of review tests as well as passed inspection by reviewers.&lt;/p&gt;

&lt;p&gt;I think it&apos;s safe.&lt;/p&gt;</comment>
                            <comment id="146687" author="jaylan" created="Wed, 23 Mar 2016 19:40:07 +0000"  >&lt;p&gt;Thanks for clarification, Bob.&lt;/p&gt;</comment>
                            <comment id="147075" author="gerrit" created="Mon, 28 Mar 2016 18:46:20 +0000"  >&lt;p&gt;Oleg Drokin (oleg.drokin@intel.com) merged in patch &lt;a href=&quot;http://review.whamcloud.com/19039/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/19039/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-5704&quot; title=&quot;lfs getstripe hangs on fifo files&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-5704&quot;&gt;&lt;del&gt;LU-5704&lt;/del&gt;&lt;/a&gt; utils: stop open hangs on fifo files&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: fab6073165dfbd107f54057e33363c77978af6cb&lt;/p&gt;</comment>
                            <comment id="147670" author="pjones" created="Sat, 2 Apr 2016 13:06:04 +0000"  >&lt;p&gt;Landed for 2.9&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                                        </outwardlinks>
                                                        </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|hzwxq7:</customfieldvalue>

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