lkml.org 
[lkml]   [2022]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] vfs: check dentry is still valid in get_link()
On Tue, Jan 18, 2022 at 02:00:41PM +1100, Dave Chinner wrote:
> > IOW, how far is xfs_inode_mark_reclaimable() from being callable in RCU
> > callback context?
>
> AIUI, not very close at all,
>
> I'm pretty sure we can't put it under RCU callback context at all
> because xfs_fs_destroy_inode() can take sleeping locks, perform
> transactions, do IO, run rcu_read_lock() critical sections, etc.
> This means that needs to run an a full task context and so can't run
> from RCU callback context at all.

Umm... AFAICS, this
pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
spin_lock(&pag->pag_ici_lock);
spin_lock(&ip->i_flags_lock);

trace_xfs_inode_set_reclaimable(ip);
ip->i_flags &= ~(XFS_NEED_INACTIVE | XFS_INACTIVATING);
ip->i_flags |= XFS_IRECLAIMABLE;
xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino),
XFS_ICI_RECLAIM_TAG);

spin_unlock(&ip->i_flags_lock);
spin_unlock(&pag->pag_ici_lock);
xfs_perag_put(pag);
in the end of xfs_inodegc_set_reclaimable() could go into ->free_inode()
just fine. It's xfs_inodegc_queue() I'm not sure about - the part
about flush_work() in there...

I'm not familiar with that code; could you point me towards some
docs/old postings/braindump/whatnot?

\
 
 \ /
  Last update: 2022-01-18 04:48    [W:0.466 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site