mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Markuze <amarkuze@redhat.com>
To: zhangdaolong <dlzhangak@isoftstone.com>
Cc: Ilya Dryomov <idryomov@gmail.com>,
	Viacheslav Dubeyko <slava@dubeyko.com>,
	ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ceph: fix inode and i_filelock_ref leak on file lock rollback
Date: Sun, 22 Nov 2026 19:38:28 +0000	[thread overview]
Message-ID: <20261122193828.1324376-1-amarkuze@redhat.com> (raw)
In-Reply-To: <1793858040.6AEC19F5.003.4jKs1y00vLz3CgW@fangwg01>

Hi Daolong,

NACK. The rollback leak is real, but skipping fl_copy_lock() for every
unlock is not the right fix.

try_unlock_file() removes the local lock before the MDS unlock is sent.
The temporary i_filelock_ref keeps the auth cap from being trimmed during
that request. Without it, another cap can cover the bits the request is
using, and the auth cap can be released while the unlock is still in
flight. A second lock from the same client can then be granted without a
new auth cap. Processing that cap release removes every advisory lock the
client holds on the inode, including the new one. The new lock remains
installed locally, so another client can be granted a conflicting lock.

The guard in ceph_fl_copy_lock() already stops a second reference when the
request lock is attached. That covers the rollback. Please keep the
reference for an ordinary unlock.

Thanks,
Alex


      reply	other threads:[~2026-11-22 19:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  5:53 zhangdaolong
2026-11-22 19:38 ` Alex Markuze [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=20261122193828.1324376-1-amarkuze@redhat.com \
    --to=amarkuze@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=dlzhangak@isoftstone.com \
    --cc=idryomov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    /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

all inboxes | Powered by JetHome®