mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: "Pavel Begunkov (Silence)" <asml.silence@gmail.com>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] locks: Fix procfs output for file leases
Date: Thu, 25 Jul 2019 07:50:50 -0400	[thread overview]
Message-ID: <342087bebc5d1eebadafcda02de067294441cd0d.camel@kernel.org> (raw)
In-Reply-To: <68a58eb885e32c1d7be0b4a531709ba2f33a758e.1563988369.git.asml.silence@gmail.com>

On Wed, 2019-07-24 at 20:16 +0300, Pavel Begunkov (Silence) wrote:
> From: Pavel Begunkov <asml.silence@gmail.com>
> 
> Since commit 778fc546f749c588aa2f ("locks: fix tracking of inprogress
> lease breaks"), leases break don't change @fl_type but modifies
> @fl_flags. However, procfs's part haven't been updated.
> 
> Previously, for a breaking lease the target type was printed (see
> target_leasetype()), as returns fcntl(F_GETLEASE). But now it's always
> "READ", as F_UNLCK no longer means "breaking". Unlike the previous
> one, this behaviour don't provide a complete description of the lease.
> 
> There are /proc/pid/fdinfo/ outputs for a lease (the same for READ and
> WRITE) breaked by O_WRONLY.
> -- before:
> lock:   1: LEASE  BREAKING  READ  2558 08:03:815793 0 EOF
> -- after:
> lock:   1: LEASE  BREAKING  UNLCK  2558 08:03:815793 0 EOF
> 
> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
> ---
>  fs/locks.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/locks.c b/fs/locks.c
> index 686eae21daf6..24d1db632f6c 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -2784,10 +2784,10 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
>  			       ? (fl->fl_type & LOCK_WRITE) ? "RW   " : "READ "
>  			       : (fl->fl_type & LOCK_WRITE) ? "WRITE" : "NONE ");
>  	} else {
> -		seq_printf(f, "%s ",
> -			       (lease_breaking(fl))
> -			       ? (fl->fl_type == F_UNLCK) ? "UNLCK" : "READ "
> -			       : (fl->fl_type == F_WRLCK) ? "WRITE" : "READ ");
> +		int type = IS_LEASE(fl) ? target_leasetype(fl) : fl->fl_type;
> +
> +		seq_printf(f, "%s ", (type == F_WRLCK) ? "WRITE" :
> +				     (type == F_RDLCK) ? "READ" : "UNLCK");
>  	}
>  	if (inode) {
>  		/* userspace relies on this representation of dev_t */

Thanks! Merged for v5.4.
-- 
Jeff Layton <jlayton@kernel.org>


      reply	other threads:[~2019-07-25 11:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 17:16 Pavel Begunkov (Silence)
2019-07-25 11:50 ` Jeff Layton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=342087bebc5d1eebadafcda02de067294441cd0d.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=asml.silence@gmail.com \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome