All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ovl: Pass ovl_get_nlink() parameters in right order
@ 2017-11-27 15:12 Vivek Goyal
  2017-11-27 18:24 ` Amir Goldstein
  0 siblings, 1 reply; 3+ messages in thread
From: Vivek Goyal @ 2017-11-27 15:12 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: linux-unionfs

Hi Amir,

I am wondering if this is a bug or it is supposed to be like this. I felt
it is a bug, so I generated a patch and sending it for your review.

Vivek


Right now we seem to be passing index as "lowerdentry" and origin.dentry
as "upperdentry". IIUC, we should pass these parameters in reversed order
and this looks like a bug.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 fs/overlayfs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
index 625ed8066570..5ef69bc09e0c 100644
--- a/fs/overlayfs/namei.c
+++ b/fs/overlayfs/namei.c
@@ -435,7 +435,7 @@ int ovl_verify_index(struct dentry *index, struct ovl_path *lower,
 
 	/* Check if index is orphan and don't warn before cleaning it */
 	if (d_inode(index)->i_nlink == 1 &&
-	    ovl_get_nlink(index, origin.dentry, 0) == 0)
+	    ovl_get_nlink(origin.dentry, index, 0) == 0)
 		err = -ENOENT;
 
 	dput(origin.dentry);

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

* Re: [PATCH] ovl: Pass ovl_get_nlink() parameters in right order
  2017-11-27 15:12 [PATCH] ovl: Pass ovl_get_nlink() parameters in right order Vivek Goyal
@ 2017-11-27 18:24 ` Amir Goldstein
  2017-12-07 10:57   ` Miklos Szeredi
  0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2017-11-27 18:24 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: overlayfs

On Mon, Nov 27, 2017 at 5:12 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
> Hi Amir,
>
> I am wondering if this is a bug or it is supposed to be like this. I felt
> it is a bug, so I generated a patch and sending it for your review.
>

Yap. That's a bug. Good catch!
I fixed test overlay/033 to catch it.

Please add cc:stable # v4.13 and Fixes tag.

Thanks!
Amir.

> Vivek
>
>
> Right now we seem to be passing index as "lowerdentry" and origin.dentry
> as "upperdentry". IIUC, we should pass these parameters in reversed order
> and this looks like a bug.
>
> Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
> ---
>  fs/overlayfs/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/overlayfs/namei.c b/fs/overlayfs/namei.c
> index 625ed8066570..5ef69bc09e0c 100644
> --- a/fs/overlayfs/namei.c
> +++ b/fs/overlayfs/namei.c
> @@ -435,7 +435,7 @@ int ovl_verify_index(struct dentry *index, struct ovl_path *lower,
>
>         /* Check if index is orphan and don't warn before cleaning it */
>         if (d_inode(index)->i_nlink == 1 &&
> -           ovl_get_nlink(index, origin.dentry, 0) == 0)
> +           ovl_get_nlink(origin.dentry, index, 0) == 0)
>                 err = -ENOENT;
>
>         dput(origin.dentry);

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

* Re: [PATCH] ovl: Pass ovl_get_nlink() parameters in right order
  2017-11-27 18:24 ` Amir Goldstein
@ 2017-12-07 10:57   ` Miklos Szeredi
  0 siblings, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2017-12-07 10:57 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Vivek Goyal, overlayfs

On Mon, Nov 27, 2017 at 7:24 PM, Amir Goldstein <amir73il@gmail.com> wrote:
> On Mon, Nov 27, 2017 at 5:12 PM, Vivek Goyal <vgoyal@redhat.com> wrote:
>> Hi Amir,
>>
>> I am wondering if this is a bug or it is supposed to be like this. I felt
>> it is a bug, so I generated a patch and sending it for your review.
>>
>
> Yap. That's a bug. Good catch!
> I fixed test overlay/033 to catch it.
>
> Please add cc:stable # v4.13 and Fixes tag.

Thanks Vivek. Added the stable and fixes tags and taken the above as
an Acked-by from Amir.

Thanks,
Miklos

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

end of thread, other threads:[~2017-12-07 10:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 15:12 [PATCH] ovl: Pass ovl_get_nlink() parameters in right order Vivek Goyal
2017-11-27 18:24 ` Amir Goldstein
2017-12-07 10:57   ` Miklos Szeredi

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.