linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locks: print unsigned ino in /proc/locks
@ 2019-12-22 18:45 Amir Goldstein
  2019-12-23  1:17 ` Jeff Layton
  0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2019-12-22 18:45 UTC (permalink / raw)
  To: Jeff Layton
  Cc: J . Bruce Fields, Miklos Szeredi, linux-unionfs, linux-nfs,
	linux-fsdevel

An ino is unsigned so export it as such in /proc/locks.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
---

Hi Jeff,

Ran into this while writing tests to verify i_ino == d_ino == st_ino on
overlayfs. In some configurations (xino=on) overlayfs sets MSB on i_ino,
so /proc/locks reports negative ino values.

BTW, the requirement for (i_ino == d_ino) came from nfsd v3 readdirplus.

Thanks,
Amir.

 fs/locks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/locks.c b/fs/locks.c
index 6970f55daf54..44b6da032842 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2853,7 +2853,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
 	}
 	if (inode) {
 		/* userspace relies on this representation of dev_t */
-		seq_printf(f, "%d %02x:%02x:%ld ", fl_pid,
+		seq_printf(f, "%d %02x:%02x:%lu ", fl_pid,
 				MAJOR(inode->i_sb->s_dev),
 				MINOR(inode->i_sb->s_dev), inode->i_ino);
 	} else {
-- 
2.17.1


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

* Re: [PATCH] locks: print unsigned ino in /proc/locks
  2019-12-22 18:45 [PATCH] locks: print unsigned ino in /proc/locks Amir Goldstein
@ 2019-12-23  1:17 ` Jeff Layton
  2019-12-23  2:58   ` Amir Goldstein
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2019-12-23  1:17 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: J . Bruce Fields, Miklos Szeredi, linux-unionfs, linux-nfs,
	linux-fsdevel

On Sun, 2019-12-22 at 20:45 +0200, Amir Goldstein wrote:
> An ino is unsigned so export it as such in /proc/locks.
> 
> Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> ---
> 
> Hi Jeff,
> 
> Ran into this while writing tests to verify i_ino == d_ino == st_ino on
> overlayfs. In some configurations (xino=on) overlayfs sets MSB on i_ino,
> so /proc/locks reports negative ino values.
> 
> BTW, the requirement for (i_ino == d_ino) came from nfsd v3 readdirplus.
> 
> Thanks,
> Amir.
> 
>  fs/locks.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 6970f55daf54..44b6da032842 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -2853,7 +2853,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
>  	}
>  	if (inode) {
>  		/* userspace relies on this representation of dev_t */
> -		seq_printf(f, "%d %02x:%02x:%ld ", fl_pid,
> +		seq_printf(f, "%d %02x:%02x:%lu ", fl_pid,
>  				MAJOR(inode->i_sb->s_dev),
>  				MINOR(inode->i_sb->s_dev), inode->i_ino);
>  	} else {

My that is an old bug! I think that goes back to early v2.x days, if not
v1.x. I'll queue it up, and maybe we can get this in for v5.6.

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>


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

* Re: [PATCH] locks: print unsigned ino in /proc/locks
  2019-12-23  1:17 ` Jeff Layton
@ 2019-12-23  2:58   ` Amir Goldstein
  2019-12-29 13:19     ` Jeff Layton
  0 siblings, 1 reply; 4+ messages in thread
From: Amir Goldstein @ 2019-12-23  2:58 UTC (permalink / raw)
  To: Jeff Layton
  Cc: J . Bruce Fields, Miklos Szeredi, overlayfs,
	Linux NFS Mailing List, linux-fsdevel

On Mon, Dec 23, 2019 at 3:17 AM Jeff Layton <jlayton@kernel.org> wrote:
>
> On Sun, 2019-12-22 at 20:45 +0200, Amir Goldstein wrote:
> > An ino is unsigned so export it as such in /proc/locks.
> >
> > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > ---
> >
> > Hi Jeff,
> >
> > Ran into this while writing tests to verify i_ino == d_ino == st_ino on
> > overlayfs. In some configurations (xino=on) overlayfs sets MSB on i_ino,
> > so /proc/locks reports negative ino values.
> >
> > BTW, the requirement for (i_ino == d_ino) came from nfsd v3 readdirplus.
> >
> > Thanks,
> > Amir.
> >
> >  fs/locks.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/locks.c b/fs/locks.c
> > index 6970f55daf54..44b6da032842 100644
> > --- a/fs/locks.c
> > +++ b/fs/locks.c
> > @@ -2853,7 +2853,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
> >       }
> >       if (inode) {
> >               /* userspace relies on this representation of dev_t */
> > -             seq_printf(f, "%d %02x:%02x:%ld ", fl_pid,
> > +             seq_printf(f, "%d %02x:%02x:%lu ", fl_pid,
> >                               MAJOR(inode->i_sb->s_dev),
> >                               MINOR(inode->i_sb->s_dev), inode->i_ino);
> >       } else {
>
> My that is an old bug! I think that goes back to early v2.x days, if not
> v1.x. I'll queue it up, and maybe we can get this in for v5.6.

I suppose you meant for v5.5?
I'd be happy if we can also mark it for stable (sorry I did not).
Reason is that I have xfstests depending on it, which test overlay
fixes that are marked for stable.

Thanks,
Amir.

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

* Re: [PATCH] locks: print unsigned ino in /proc/locks
  2019-12-23  2:58   ` Amir Goldstein
@ 2019-12-29 13:19     ` Jeff Layton
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Layton @ 2019-12-29 13:19 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: J . Bruce Fields, Miklos Szeredi, overlayfs,
	Linux NFS Mailing List, linux-fsdevel

On Mon, 2019-12-23 at 04:58 +0200, Amir Goldstein wrote:
> On Mon, Dec 23, 2019 at 3:17 AM Jeff Layton <jlayton@kernel.org> wrote:
> > On Sun, 2019-12-22 at 20:45 +0200, Amir Goldstein wrote:
> > > An ino is unsigned so export it as such in /proc/locks.
> > > 
> > > Signed-off-by: Amir Goldstein <amir73il@gmail.com>
> > > ---
> > > 
> > > Hi Jeff,
> > > 
> > > Ran into this while writing tests to verify i_ino == d_ino == st_ino on
> > > overlayfs. In some configurations (xino=on) overlayfs sets MSB on i_ino,
> > > so /proc/locks reports negative ino values.
> > > 
> > > BTW, the requirement for (i_ino == d_ino) came from nfsd v3 readdirplus.
> > > 
> > > Thanks,
> > > Amir.
> > > 
> > >  fs/locks.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/fs/locks.c b/fs/locks.c
> > > index 6970f55daf54..44b6da032842 100644
> > > --- a/fs/locks.c
> > > +++ b/fs/locks.c
> > > @@ -2853,7 +2853,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
> > >       }
> > >       if (inode) {
> > >               /* userspace relies on this representation of dev_t */
> > > -             seq_printf(f, "%d %02x:%02x:%ld ", fl_pid,
> > > +             seq_printf(f, "%d %02x:%02x:%lu ", fl_pid,
> > >                               MAJOR(inode->i_sb->s_dev),
> > >                               MINOR(inode->i_sb->s_dev), inode->i_ino);
> > >       } else {
> > 
> > My that is an old bug! I think that goes back to early v2.x days, if not
> > v1.x. I'll queue it up, and maybe we can get this in for v5.6.
> 
> I suppose you meant for v5.5?
> I'd be happy if we can also mark it for stable (sorry I did not).
> Reason is that I have xfstests depending on it, which test overlay
> fixes that are marked for stable.
> 

Oh! I didn't realize the urgency. It's been in -next for a week or so
now, so I think it's probably safe enough. I'll send a PR soon, after I
give it a bit more testing.

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>


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

end of thread, other threads:[~2019-12-29 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-22 18:45 [PATCH] locks: print unsigned ino in /proc/locks Amir Goldstein
2019-12-23  1:17 ` Jeff Layton
2019-12-23  2:58   ` Amir Goldstein
2019-12-29 13:19     ` Jeff Layton

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).