Re: [PATCH v2] filelock: don't hand out a delegation that is being recalled

From: Hungyu Lin

Date: Sat Dec 05 2026 - 03:54:00 EST


> I'll ponder this, but for the moment I don't see a compelling reason to
> do this here.

I think it may not need to go in the common code. F_SETDELEG could get
its own lease_manager_operations, like nfsd: lm_break remembers the
inode in a bloom filter like nfsd's, and lm_open_conflict refuses a new
delegation on it for a while.

Two things I'm not sure about:

1. The filter is shared, so many recalls could make F_SETDELEG fail
for everyone for a bit. nfsd seems to have the same problem.

2. How long to block. For now it is 5 to 10 lease break times, since
vfs_rename() can wait on 4 delegations in turn and each holder can
let its delegation time out and take it again, so the block has to
outlast all 4. That's probably too long for holders that return it
right away. Maybe only a timed-out delegation needs the long block.

I have a version of this working here. Does that sound reasonable, or
am I missing something?

Thanks,
Hungyu