Re: Blocklayoutdriver deadlock with knfsd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Nov 16, 2023, at 12:11 PM, Benjamin Coddington <bcodding@xxxxxxxxxx> wrote:
> 
> I ran into this old problem again recently, last discussed here:
> https://lore.kernel.org/linux-nfs/F738DB31-B527-4048-94A7-DBF00533F8C1@xxxxxxxxxx/#t
> 
> Problem is that clients can easily issue enough WRITEs that end up in
> 
> __break_lease
> xfs_break_leased_layouts
> ...
> nfsd_vfs_write
> ...
> svc_process
> svc_recv
> nfsd
> 
> .. so that all the knfsds are there, and nothing can process the
> LAYOUTRETURN.
> 
> I'm pretty sure we can make the linux client a bit smarter about it (I saw
> one LAYOUTGET and one conflicting WRITE in the same TCP segment, in that
> order).
> 
> But what can knfsd do to defend itself?

If nfsd threads are waiting indefinitely, that's a potential DoS
vector. Ideally the thread should preserve the waiting request
somehow (or return NFS4ERR_DELAY, maybe?). At some later point
when the lease conflict is resolved, the requests can be reprocessed.

That's my naive 800,000 ft view.


--
Chuck Lever






[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux