[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1dee278b-6c96-eec2-ce76-fe6e07c6e20f@linux.alibaba.com>
Date: Tue, 10 Sep 2019 14:45:03 +0800
From: Joseph Qi <joseph.qi@...ux.alibaba.com>
To: Ding Xiang <dingxiang@...s.chinamobile.com>, mark@...heh.com,
jlbec@...lplan.org, Andrew Morton <akpm@...ux-foundation.org>
Cc: ocfs2-devel@....oracle.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ocfs2: Fix passing zero to 'PTR_ERR' warning
On 19/9/9 18:04, Ding Xiang wrote:
> Fix a static code checker warning:
> fs/ocfs2/acl.c:331
> ocfs2_acl_chmod() warn: passing zero to 'PTR_ERR'
>
> Fixes: 5ee0fbd50fd ("ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang")
> Signed-off-by: Ding Xiang <dingxiang@...s.chinamobile.com>
Reviewed-by: Joseph Qi <joseph.qi@...ux.alibaba.com>
> ---
> fs/ocfs2/acl.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c
> index 3e7da39..bb981ec 100644
> --- a/fs/ocfs2/acl.c
> +++ b/fs/ocfs2/acl.c
> @@ -327,8 +327,8 @@ int ocfs2_acl_chmod(struct inode *inode, struct buffer_head *bh)
> down_read(&OCFS2_I(inode)->ip_xattr_sem);
> acl = ocfs2_get_acl_nolock(inode, ACL_TYPE_ACCESS, bh);
> up_read(&OCFS2_I(inode)->ip_xattr_sem);
> - if (IS_ERR(acl) || !acl)
> - return PTR_ERR(acl);
> + if (IS_ERR_OR_NULL(acl))
> + return PTR_ERR_OR_ZERO(acl);
> ret = __posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
> if (ret)
> return ret;
>
Powered by blists - more mailing lists