linux-unionfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ovl: remove not used argument in ovl_check_origin
@ 2020-06-21 12:50 youngjun
  2020-06-21 13:15 ` Amir Goldstein
  0 siblings, 1 reply; 2+ messages in thread
From: youngjun @ 2020-06-21 12:50 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs, youngjun

ovl_check_origin outparam 'ctrp' argument
not used by caller. So, remove this argument
from ovl_check_origin.

Signed-off-by: youngjun <her0gyugyu@gmail.com>
---
 fs/overlayfs/namei.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 3566282a9199..3cad68c3efb2 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -389,7 +389,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,
 }
 
 static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
-			    struct ovl_path **stackp, unsigned int *ctrp)
+			    struct ovl_path **stackp)
 {
 	struct ovl_fh *fh = ovl_get_fh(upperdentry, OVL_XATTR_ORIGIN);
 	int err;
@@ -406,10 +406,6 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
 		return err;
 	}
 
-	if (WARN_ON(*ctrp))
-		return -EIO;
-
-	*ctrp = 1;
 	return 0;
 }
 
@@ -861,8 +857,6 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
 			goto out;
 		}
 		if (upperdentry && !d.is_dir) {
-			unsigned int origin_ctr = 0;
-
 			/*
 			 * Lookup copy up origin by decoding origin file handle.
 			 * We may get a disconnected dentry, which is fine,
@@ -873,8 +867,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
 			 * number - it's the same as if we held a reference
 			 * to a dentry in lower layer that was moved under us.
 			 */
-			err = ovl_check_origin(ofs, upperdentry, &origin_path,
-					       &origin_ctr);
+			err = ovl_check_origin(ofs, upperdentry, &origin_path);
 			if (err)
 				goto out_put_upper;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ovl: remove not used argument in ovl_check_origin
  2020-06-21 12:50 [PATCH] ovl: remove not used argument in ovl_check_origin youngjun
@ 2020-06-21 13:15 ` Amir Goldstein
  0 siblings, 0 replies; 2+ messages in thread
From: Amir Goldstein @ 2020-06-21 13:15 UTC (permalink / raw)
  To: youngjun; +Cc: Miklos Szeredi, overlayfs

On Sun, Jun 21, 2020 at 3:50 PM youngjun <her0gyugyu@gmail.com> wrote:
>
> ovl_check_origin outparam 'ctrp' argument
> not used by caller. So, remove this argument
> from ovl_check_origin.
>
> Signed-off-by: youngjun <her0gyugyu@gmail.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  fs/overlayfs/namei.c | 11 ++---------
>  1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> index 3566282a9199..3cad68c3efb2 100644
> --- a/fs/overlayfs/namei.c
> +++ b/fs/overlayfs/namei.c
> @@ -389,7 +389,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, bool connected,
>  }
>
>  static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
> -                           struct ovl_path **stackp, unsigned int *ctrp)
> +                           struct ovl_path **stackp)
>  {
>         struct ovl_fh *fh = ovl_get_fh(upperdentry, OVL_XATTR_ORIGIN);
>         int err;
> @@ -406,10 +406,6 @@ static int ovl_check_origin(struct ovl_fs *ofs, struct dentry *upperdentry,
>                 return err;
>         }
>
> -       if (WARN_ON(*ctrp))
> -               return -EIO;
> -
> -       *ctrp = 1;
>         return 0;
>  }
>
> @@ -861,8 +857,6 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>                         goto out;
>                 }
>                 if (upperdentry && !d.is_dir) {
> -                       unsigned int origin_ctr = 0;
> -
>                         /*
>                          * Lookup copy up origin by decoding origin file handle.
>                          * We may get a disconnected dentry, which is fine,
> @@ -873,8 +867,7 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
>                          * number - it's the same as if we held a reference
>                          * to a dentry in lower layer that was moved under us.
>                          */
> -                       err = ovl_check_origin(ofs, upperdentry, &origin_path,
> -                                              &origin_ctr);
> +                       err = ovl_check_origin(ofs, upperdentry, &origin_path);
>                         if (err)
>                                 goto out_put_upper;
>
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-21 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-21 12:50 [PATCH] ovl: remove not used argument in ovl_check_origin youngjun
2020-06-21 13:15 ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).