Re: [bug report from fstests] BUG: sleeping function called from invalid context at fs/nfsd/filecache.c:360

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

 



On Mon, Nov 11, 2024 at 09:02:38AM -0500, Jeff Layton wrote:
> On Mon, 2024-11-11 at 20:57 +0800, Zorro Lang wrote:
> > Lots of fstests cases fail on nfs, e.g. [1]. The dmesg output as [2].
> > I tested on linux v6.12-rc6+, with HEAD=da4373fbcf006deda90e5e6a87c499e0ff747572
> > 
> > Thanks,
> > Zorro
> > 
> 
> This looks wrong:
> 
> static inline void nfs_to_nfsd_file_put_local(struct nfsd_file *localio)                            
> {                                                                                                   
>         /*                                                                                          
>          * Once reference to nfsd_serv is dropped, NFSD could be                                    
>          * unloaded, so ensure safe return from nfsd_file_put_local()                               
>          * by always taking RCU.                                                                    
>          */                                                                                         
>         rcu_read_lock();                                                                            
>         nfs_to->nfsd_file_put_local(localio);                                                       
>         rcu_read_unlock();                                                                          
> }    
> 
> nfsd_file_put_local() calls nfsd_file_put, which can sleep. What
> exactly is the scenario that you're guarding against with the RCU read
> lock?

nfs_to lifetime vs nfsd unload.  But anyway, this was fixed in the 2nd
patch of my recent LOCALIO series that I posted on Friday, see:

https://lore.kernel.org/linux-nfs/20241108234002.16392-3-snitzer@xxxxxxxxxx/

Would be good to get this in before 6.12 final (Neil gave his
Reviewed-by last night).

Thanks,
Mike




[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