<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:39:23 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-4069] bad GOTOs</title>
                <link>https://jira.whamcloud.com/browse/LU-4069</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Using the coccinelle script below we can easily find statements of the form GOTO(label, -ERRNO):&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;@@
identifier I;
expression E;
@@

* GOTO(I, -E)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here are the results:&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;diff = 
diff -u -p lustre/mdt/mdt_xattr.c /tmp/nothing/mdt/mdt_xattr.c
--- lustre/mdt/mdt_xattr.c
+++ /tmp/nothing/mdt/mdt_xattr.c
@@ -419,7 +419,6 @@ int mdt_reint_setxattr(struct mdt_thread
                             sizeof(XATTR_NAME_ACL_DEFAULT) - 1) == 0)) {
                 /* currently lustre limit acl access size */
                 if (xattr_len &amp;gt; LUSTRE_POSIX_ACL_MAX_SIZE)
-                        GOTO(out, -ERANGE);
         }
 
         lockpart = MDS_INODELOCK_UPDATE;

diff -u -p lustre/quota/qsd_request.c /tmp/nothing/quota/qsd_request.c
--- lustre/quota/qsd_request.c
+++ /tmp/nothing/quota/qsd_request.c
@@ -287,7 +287,6 @@ int qsd_intent_lock(const struct lu_env
 		lock = ldlm_handle2lock(&amp;amp;qti-&amp;gt;qti_lockh);
 		if (lock == NULL) {
 			ptlrpc_req_finished(req);
-			GOTO(out, -ENOLCK);
 		}
 		lu_ref_add(&amp;amp;qqi-&amp;gt;qqi_reference, &quot;glb_lock&quot;, lock);
 		LDLM_LOCK_PUT(lock);
diff -u -p lustre/ldlm/ldlm_inodebits.c /tmp/nothing/ldlm/ldlm_inodebits.c
--- lustre/ldlm/ldlm_inodebits.c
+++ /tmp/nothing/ldlm/ldlm_inodebits.c
@@ -228,7 +228,6 @@ int ldlm_process_inodebits_lock(struct l
                                        LDLM_WORK_BL_AST);
                 lock_res(res);
                 if (rc == -ERESTART)
-                        GOTO(restart, -ERESTART);
                 *flags |= LDLM_FL_BLOCK_GRANTED;
         } else {
                 ldlm_resource_unlink_lock(lock);

diff -u -p lustre/ldlm/ldlm_flock.c /tmp/nothing/ldlm/ldlm_flock.c
--- lustre/ldlm/ldlm_flock.c
+++ /tmp/nothing/ldlm/ldlm_flock.c
@@ -602,7 +602,6 @@ restart:
                                                        LDLM_WORK_CP_AST);
                                 lock_res_and_lock(req);
                                 if (rc == -ERESTART)
-                                        GOTO(restart, -ERESTART);
                        }
                 } else {
                         LASSERT(req-&amp;gt;l_completion_ast);

@@ -184,7 +184,6 @@ int ldlm_process_plain_lock(struct ldlm_
                                        LDLM_WORK_BL_AST);
                 lock_res(res);
                 if (rc == -ERESTART)
-                        GOTO(restart, -ERESTART);
                 *flags |= LDLM_FL_BLOCK_GRANTED;
         } else {
                 ldlm_resource_unlink_lock(lock);

@@ -783,7 +783,6 @@ int ldlm_process_extent_lock(struct ldlm
 				GOTO(out, rc = 0);
 			}
 
-			GOTO(restart, -ERESTART);
 		}
 
 		/* this way we force client to wait for the lock


diff -u -p lustre/osd-zfs/osd_io.c /tmp/nothing/osd-zfs/osd_io.c
--- lustre/osd-zfs/osd_io.c
+++ /tmp/nothing/osd-zfs/osd_io.c
@@ -351,7 +351,6 @@ static int osd_bufs_get_write(const stru
 
 			abuf = dmu_request_arcbuf(obj-&amp;gt;oo_db, bs);
 			if (unlikely(abuf == NULL))
-				GOTO(out_err, -ENOMEM);
 
 			cfs_atomic_inc(&amp;amp;osd-&amp;gt;od_zerocopy_loan);
 
@@ -402,7 +401,6 @@ static int osd_bufs_get_write(const stru
 
 				lnb[i].page = alloc_page(OSD_GFP_IO);
 				if (unlikely(lnb[i].page == NULL))
-					GOTO(out_err, -ENOMEM);
 
 				LASSERT(lnb[i].page-&amp;gt;mapping == NULL);
 				lnb[i].page-&amp;gt;mapping = (void *)obj;


diff -u -p lustre/obdclass/genops.c /tmp/nothing/obdclass/genops.c
--- lustre/obdclass/genops.c
+++ /tmp/nothing/obdclass/genops.c
@@ -671,26 +671,22 @@ int obd_init_caches(void)
 					      sizeof(struct obd_device),
 					      0, 0, NULL);
 	if (!obd_device_cachep)
-		GOTO(out, -ENOMEM);
 
 	LASSERT(obdo_cachep == NULL);
 	obdo_cachep = kmem_cache_create(&quot;ll_obdo_cache&quot;, sizeof(struct obdo),
 					0, 0, NULL);
 	if (!obdo_cachep)
-		GOTO(out, -ENOMEM);
 
 	LASSERT(import_cachep == NULL);
 	import_cachep = kmem_cache_create(&quot;ll_import_cache&quot;,
 					  sizeof(struct obd_import),
 					  0, 0, NULL);
 	if (!import_cachep)
-		GOTO(out, -ENOMEM);
 
 	LASSERT(capa_cachep == NULL);
 	capa_cachep = kmem_cache_create(&quot;capa_cache&quot;, sizeof(struct obd_capa),
 					0, 0, NULL);
 	if (!capa_cachep)
-		GOTO(out, -ENOMEM);
 
 	RETURN(0);
 out:
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Note that despite its format, the coccinelle output is not to be taken as a literal patch. Also the LDLM GOTOs are not bugs per-se.&lt;/p&gt;</description>
                <environment></environment>
        <key id="21282">LU-4069</key>
            <summary>bad GOTOs</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="dmiter">Dmitry Eremin</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>coccinelle</label>
                    </labels>
                <created>Sat, 5 Oct 2013 01:46:37 +0000</created>
                <updated>Mon, 2 Dec 2013 13:05:37 +0000</updated>
                            <resolved>Mon, 2 Dec 2013 13:05:37 +0000</resolved>
                                    <version>Lustre 2.5.0</version>
                                    <fixVersion>Lustre 2.6.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                    <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|hzw4w7:</customfieldvalue>

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