All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ovl: make i_ino consistent with st_ino in more cases
@ 2019-06-09 16:03 Amir Goldstein
  2019-06-11 13:58 ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2019-06-09 16:03 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-unionfs

Relax the condition that overlayfs supports nfs export, to require
that i_ino is consistent with st_ino/d_ino.

It is enough to require that st_ino and d_ino are consistent.

This fixes the failure of xfstest generic/504, due to mismatch of
st_ino to inode number in the output of /proc/locks.

Fixes: 12574a9f4c9c ("ovl: consistent i_ino for non-samefs with xino")
Cc: <stable@vger.kernel.org> # v4.19
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Miklos,

TBH, I can't remember why I put the s_export_op condition in the
first place (can you?), expect for the fact the original bug fix
was reported on nfsd readdirplus.

Thanks,
Amir.

 fs/overlayfs/inode.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index f7eba21effa5..f0389849fd80 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -553,15 +553,15 @@ static void ovl_fill_inode(struct inode *inode, umode_t mode, dev_t rdev,
 	int xinobits = ovl_xino_bits(inode->i_sb);
 
 	/*
-	 * When NFS export is enabled and d_ino is consistent with st_ino
-	 * (samefs or i_ino has enough bits to encode layer), set the same
-	 * value used for d_ino to i_ino, because nfsd readdirplus compares
-	 * d_ino values to i_ino values of child entries. When called from
+	 * When d_ino is consistent with st_ino (samefs or i_ino has enough
+	 * bits to encode layer), set the same value used for st_ino to i_ino,
+	 * so inode number exposed via /proc/locks and a like will be
+	 * consistent with d_ino and st_ino values. An i_ino value inconsistent
+	 * with d_ino also causes nfsd readdirplus to fail.  When called from
 	 * ovl_new_inode(), ino arg is 0, so i_ino will be updated to real
 	 * upper inode i_ino on ovl_inode_init() or ovl_inode_update().
 	 */
-	if (inode->i_sb->s_export_op &&
-	    (ovl_same_sb(inode->i_sb) || xinobits)) {
+	if (ovl_same_sb(inode->i_sb) || xinobits) {
 		inode->i_ino = ino;
 		if (xinobits && fsid && !(ino >> (64 - xinobits)))
 			inode->i_ino |= (unsigned long)fsid << (64 - xinobits);
-- 
2.17.1

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

* Re: [PATCH] ovl: make i_ino consistent with st_ino in more cases
  2019-06-09 16:03 [PATCH] ovl: make i_ino consistent with st_ino in more cases Amir Goldstein
@ 2019-06-11 13:58 ` Miklos Szeredi
  2019-06-18 13:36   ` Amir Goldstein
  0 siblings, 1 reply; 4+ messages in thread
From: Miklos Szeredi @ 2019-06-11 13:58 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: overlayfs

On Sun, Jun 9, 2019 at 6:03 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> Relax the condition that overlayfs supports nfs export, to require
> that i_ino is consistent with st_ino/d_ino.
>
> It is enough to require that st_ino and d_ino are consistent.

Yes.

>
> This fixes the failure of xfstest generic/504, due to mismatch of
> st_ino to inode number in the output of /proc/locks.
>
> Fixes: 12574a9f4c9c ("ovl: consistent i_ino for non-samefs with xino")
> Cc: <stable@vger.kernel.org> # v4.19
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
>
> Miklos,
>
> TBH, I can't remember why I put the s_export_op condition in the
> first place (can you?), expect for the fact the original bug fix
> was reported on nfsd readdirplus.

I have no recollection of any issue that would require nfs export.

I've applied the patch.

Thanks,
Miklos

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

* Re: [PATCH] ovl: make i_ino consistent with st_ino in more cases
  2019-06-11 13:58 ` Miklos Szeredi
@ 2019-06-18 13:36   ` Amir Goldstein
  2019-06-19  7:03     ` Miklos Szeredi
  0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2019-06-18 13:36 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: overlayfs

On Tue, Jun 11, 2019 at 4:58 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Sun, Jun 9, 2019 at 6:03 PM Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > Relax the condition that overlayfs supports nfs export, to require
> > that i_ino is consistent with st_ino/d_ino.
> >
> > It is enough to require that st_ino and d_ino are consistent.
>
> Yes.
>
> >
> > This fixes the failure of xfstest generic/504, due to mismatch of
> > st_ino to inode number in the output of /proc/locks.
> >
> > Fixes: 12574a9f4c9c ("ovl: consistent i_ino for non-samefs with xino")
> > Cc: <stable@vger.kernel.org> # v4.19
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >
> > Miklos,
> >
> > TBH, I can't remember why I put the s_export_op condition in the
> > first place (can you?), expect for the fact the original bug fix
> > was reported on nfsd readdirplus.
>
> I have no recollection of any issue that would require nfs export.
>
> I've applied the patch.
>

Forgot to apply to overlayfs-next or intentionally left for 5.3?

Thanks,
Amir.

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

* Re: [PATCH] ovl: make i_ino consistent with st_ino in more cases
  2019-06-18 13:36   ` Amir Goldstein
@ 2019-06-19  7:03     ` Miklos Szeredi
  0 siblings, 0 replies; 4+ messages in thread
From: Miklos Szeredi @ 2019-06-19  7:03 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: overlayfs

On Tue, Jun 18, 2019 at 3:36 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Tue, Jun 11, 2019 at 4:58 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
> >
> > On Sun, Jun 9, 2019 at 6:03 PM Amir Goldstein <amir73il@gmail.com> wrote:

> > > TBH, I can't remember why I put the s_export_op condition in the
> > > first place (can you?), expect for the fact the original bug fix
> > > was reported on nfsd readdirplus.
> >
> > I have no recollection of any issue that would require nfs export.
> >
> > I've applied the patch.
> >
>
> Forgot to apply to overlayfs-next or intentionally left for 5.3?

Safer to leave it to 5.3 since this is not a recent regression and the
only reporter is xfstests.

Thanks,
Miklos

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

end of thread, other threads:[~2019-06-19  7:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09 16:03 [PATCH] ovl: make i_ino consistent with st_ino in more cases Amir Goldstein
2019-06-11 13:58 ` Miklos Szeredi
2019-06-18 13:36   ` Amir Goldstein
2019-06-19  7:03     ` 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.