diff mbox

ceph: replace variable ret using err for error case in ceph_pre_init_acls()

Message ID 20180709144807.23632-1-cgxu519@gmx.com (mailing list archive)
State New, archived
Headers show

Commit Message

Chengguang Xu July 9, 2018, 2:48 p.m. UTC
In order to return correct error code should replace variable ret
using err in error case.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
 fs/ceph/acl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Yan, Zheng July 11, 2018, 7:08 a.m. UTC | #1
On Mon, Jul 9, 2018 at 10:51 PM Chengguang Xu <cgxu519@gmx.com> wrote:
>
> In order to return correct error code should replace variable ret
> using err in error case.
>
> Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
> ---
>  fs/ceph/acl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c
> index 3351ea14390b..027408d55aee 100644
> --- a/fs/ceph/acl.c
> +++ b/fs/ceph/acl.c
> @@ -185,10 +185,10 @@ int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
>                 return err;
>
>         if (acl) {
> -               int ret = posix_acl_equiv_mode(acl, mode);
> -               if (ret < 0)
> +               err = posix_acl_equiv_mode(acl, mode);
> +               if (err < 0)
>                         goto out_err;
> -               if (ret == 0) {
> +               if (err == 0) {
>                         posix_acl_release(acl);
>                         acl = NULL;
>                 }
> --
> 2.17.1
>

Applied, thanks

Yan, Zheng

> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/acl.c b/fs/ceph/acl.c
index 3351ea14390b..027408d55aee 100644
--- a/fs/ceph/acl.c
+++ b/fs/ceph/acl.c
@@ -185,10 +185,10 @@  int ceph_pre_init_acls(struct inode *dir, umode_t *mode,
 		return err;
 
 	if (acl) {
-		int ret = posix_acl_equiv_mode(acl, mode);
-		if (ret < 0)
+		err = posix_acl_equiv_mode(acl, mode);
+		if (err < 0)
 			goto out_err;
-		if (ret == 0) {
+		if (err == 0) {
 			posix_acl_release(acl);
 			acl = NULL;
 		}