From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joe Perches Date: Fri, 16 Dec 2016 08:05:53 -0800 Subject: [lustre-devel] [PATCH] staging : lustre : Remove braces from single-line body. In-Reply-To: <1481898571-16842-1-git-send-email-khan.tabrez21@gmail.com> References: <1481898571-16842-1-git-send-email-khan.tabrez21@gmail.com> Message-ID: <1481904353.29291.87.camel@perches.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tabrez khan , andreas.dilger@intel.com, jsimmons@infradead.org Cc: gregkh@linuxfoundation.org, lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org On Fri, 2016-12-16 at 19:59 +0530, Tabrez khan wrote: > Remove unnecessary braces {} for single while statement. Your patch is fine Tabrez, but to the lustre folk: > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c [] > @@ -1371,9 +1371,9 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_sync_io *anchor, LASSERT(atomic_read(&anchor->csi_sync_nr) == 0); /* wait until cl_sync_io_note() has done wakeup */ - while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) { + while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) cpu_relax(); - } + What if the wakeup never occurs/succeeds? Should there be a timeout? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933895AbcLPQGI (ORCPT ); Fri, 16 Dec 2016 11:06:08 -0500 Received: from smtprelay0071.hostedemail.com ([216.40.44.71]:56440 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1762041AbcLPQF6 (ORCPT ); Fri, 16 Dec 2016 11:05:58 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:968:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3350:3622:3865:3867:3871:4321:5007:10004:10400:10848:11026:11232:11657:11658:11914:12043:12296:12740:12760:12895:13069:13163:13229:13311:13357:13439:14659:14721:21080:21324:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: cup16_33a226bb2bf1c X-Filterd-Recvd-Size: 1611 Message-ID: <1481904353.29291.87.camel@perches.com> Subject: Re: [PATCH] staging : lustre : Remove braces from single-line body. From: Joe Perches To: Tabrez khan , andreas.dilger@intel.com, jsimmons@infradead.org Cc: gregkh@linuxfoundation.org, lustre-devel@lists.lustre.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Fri, 16 Dec 2016 08:05:53 -0800 In-Reply-To: <1481898571-16842-1-git-send-email-khan.tabrez21@gmail.com> References: <1481898571-16842-1-git-send-email-khan.tabrez21@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2016-12-16 at 19:59 +0530, Tabrez khan wrote: > Remove unnecessary braces {} for single while statement. Your patch is fine Tabrez, but to the lustre folk: > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c [] > @@ -1371,9 +1371,9 @@ int cl_sync_io_wait(const struct lu_env *env, struct cl_sync_io *anchor, LASSERT(atomic_read(&anchor->csi_sync_nr) == 0); /* wait until cl_sync_io_note() has done wakeup */ - while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) { + while (unlikely(atomic_read(&anchor->csi_barrier) != 0)) cpu_relax(); - } + What if the wakeup never occurs/succeeds? Should there be a timeout?