Re: [PATCH] fs/locks: print full locks information

2021-02-21 Thread J. Bruce Fields
On Sun, Feb 21, 2021 at 01:43:03PM -0500, Jeff Layton wrote: > On Sun, 2021-02-21 at 16:52 +, Al Viro wrote: > > On Sat, Feb 20, 2021 at 01:32:50AM -0500, Luo Longjun wrote: > > > + list_for_each_entry(bfl, &fl->fl_blocked_requests, fl_blocked_member) > > > + __locks_show(f, bfl, level

Re: [PATCH] fs/locks: print full locks information

2021-02-21 Thread Jeff Layton
On Sun, 2021-02-21 at 16:52 +, Al Viro wrote: > On Sat, Feb 20, 2021 at 01:32:50AM -0500, Luo Longjun wrote: > >   > > > > @@ -2844,7 +2845,13 @@ static void lock_get_status(struct seq_file *f, > > struct file_lock *fl, > >   if (fl->fl_file != NULL) > >   inode = locks_inode(fl->

Re: [PATCH] fs/locks: print full locks information

2021-02-21 Thread Al Viro
On Sat, Feb 20, 2021 at 01:32:50AM -0500, Luo Longjun wrote: > > @@ -2844,7 +2845,13 @@ static void lock_get_status(struct seq_file *f, struct > file_lock *fl, > if (fl->fl_file != NULL) > inode = locks_inode(fl->fl_file); > > - seq_printf(f, "%lld:%s ", id, pfx); > +

Re: [PATCH] fs/locks: print full locks information

2021-02-21 Thread Jeff Layton
On Sat, 2021-02-20 at 01:32 -0500, Luo Longjun wrote: > Commit fd7732e033e3 ("fs/locks: create a tree of dependent requests.") > has put blocked locks into a tree. > > So, with a for loop, we can't check all locks information. > > To solve this problem, we should traverse the tree by DFS. > > Si

[PATCH] fs/locks: print full locks information

2021-02-20 Thread Luo Longjun
Commit fd7732e033e3 ("fs/locks: create a tree of dependent requests.") has put blocked locks into a tree. So, with a for loop, we can't check all locks information. To solve this problem, we should traverse the tree by DFS. Signed-off-by: Luo Longjun --- fs/locks.c | 30 +++