All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: check if the ocfs2 lock resource be initialized before calling ocfs2_dlm_lock
Date: Wed, 1 Apr 2015 08:43:45 +0800	[thread overview]
Message-ID: <551B3F41.6020501@huawei.com> (raw)
In-Reply-To: <20150331151348.2887ede16683257826833e04@linux-foundation.org>

Hi Andrew,

On 2015/4/1 6:13, Andrew Morton wrote:
> On Mon, 30 Mar 2015 11:22:13 +0800 alex chen <alex.chen@huawei.com> wrote:
> 
>> --- a/fs/ocfs2/dlmglue.c
>> +++ b/fs/ocfs2/dlmglue.c
>> @@ -1391,6 +1391,11 @@ static int __ocfs2_cluster_lock(struct ocfs2_super *osb,
>>  	int noqueue_attempted = 0;
>>  	int dlm_locked = 0;
>>
>> +	if (!(lockres->l_flags & OCFS2_LOCK_INITIALIZED)) {
>> +		mlog_errno(-EINVAL);
>> +		return -EINVAL;
>> +	}
> 
> hm.  How about we do this?
> 
> 
> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: ocfs2: make mlog_errno return the errno
> 
> ocfs2 does
> 
> 	mlog_errno(v);
> 	return v;
> 
> in many places.  Change mlog_errno() so we can do
> 
> 	return mlog_errno(v);
> 
I don't think this is fit for all.
In many places it should do cleanup rather than just return the error
code.

> For some weird reason this patch reduces the size of ocfs2 by 6k:
> 
> akpm3:/usr/src/25> size fs/ocfs2/ocfs2.ko
>    text    data     bss     dec     hex filename
> 1146613   82767  832192 2061572  1f7504 fs/ocfs2/ocfs2.ko-before
> 1140857   82767  832192 2055816  1f5e88 fs/ocfs2/ocfs2.ko-after
> 
> Cc: Mark Fasheh <mfasheh@suse.com>
> Cc: Joel Becker <jlbec@evilplan.org>
> Cc: alex chen <alex.chen@huawei.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  fs/ocfs2/cluster/masklog.h |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff -puN fs/ocfs2/cluster/masklog.h~a fs/ocfs2/cluster/masklog.h
> --- a/fs/ocfs2/cluster/masklog.h~a
> +++ a/fs/ocfs2/cluster/masklog.h
> @@ -196,13 +196,14 @@ extern struct mlog_bits mlog_and_bits, m
>  	}								\
>  } while (0)
>  
> -#define mlog_errno(st) do {						\
> +#define mlog_errno(st) ({						\
>  	int _st = (st);							\
>  	if (_st != -ERESTARTSYS && _st != -EINTR &&			\
>  	    _st != AOP_TRUNCATED_PAGE && _st != -ENOSPC &&		\
>  	    _st != -EDQUOT)						\
>  		mlog(ML_ERROR, "status = %lld\n", (long long)_st);	\
> -} while (0)
> +	st;								\
> +})
>  
>  #define mlog_bug_on_msg(cond, fmt, args...) do {			\
>  	if (cond) {							\
> _
> 
> 
> .
> 

  reply	other threads:[~2015-04-01  0:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  3:22 [Ocfs2-devel] [PATCH] ocfs2: check if the ocfs2 lock resource be initialized before calling ocfs2_dlm_lock alex chen
2015-03-31 22:13 ` Andrew Morton
2015-04-01  0:43   ` Joseph Qi [this message]
2015-04-01  2:19     ` Andrew Morton
2015-04-02  3:14       ` alex chen
2015-04-02  3:45         ` Andrew Morton
2015-04-16  7:28 ` Junxiao Bi
2015-04-21  2:54   ` alex chen
2015-04-22  1:46     ` Junxiao Bi
2015-04-22  8:14       ` alex chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=551B3F41.6020501@huawei.com \
    --to=joseph.qi@huawei.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.