mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
gfs2: Check inode generation number in delete_work_func
In delete_work_func, if the iopen glock still has an inode attached, limit the inode lookup to that specific generation number: in the likely case that the inode was deleted on the node on which the inode's link count dropped to zero, we can skip verifying the on-disk block type and reading in the inode. The same applies if another node that had the inode open managed to delete the inode before us. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
parent
b66648ad6d
commit
b0dcffd8da
2 changed files with 7 additions and 2 deletions
|
@ -795,6 +795,7 @@ static bool gfs2_try_evict(struct gfs2_glock *gl)
|
||||||
ip = NULL;
|
ip = NULL;
|
||||||
spin_unlock(&gl->gl_lockref.lock);
|
spin_unlock(&gl->gl_lockref.lock);
|
||||||
if (ip) {
|
if (ip) {
|
||||||
|
gl->gl_no_formal_ino = ip->i_no_formal_ino;
|
||||||
set_bit(GIF_DEFERRED_DELETE, &ip->i_flags);
|
set_bit(GIF_DEFERRED_DELETE, &ip->i_flags);
|
||||||
d_prune_aliases(&ip->i_inode);
|
d_prune_aliases(&ip->i_inode);
|
||||||
iput(&ip->i_inode);
|
iput(&ip->i_inode);
|
||||||
|
@ -843,7 +844,8 @@ static void delete_work_func(struct work_struct *work)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inode = gfs2_lookup_by_inum(sdp, no_addr, 0, GFS2_BLKST_UNLINKED);
|
inode = gfs2_lookup_by_inum(sdp, no_addr, gl->gl_no_formal_ino,
|
||||||
|
GFS2_BLKST_UNLINKED);
|
||||||
if (!IS_ERR_OR_NULL(inode)) {
|
if (!IS_ERR_OR_NULL(inode)) {
|
||||||
d_prune_aliases(inode);
|
d_prune_aliases(inode);
|
||||||
iput(inode);
|
iput(inode);
|
||||||
|
|
|
@ -380,7 +380,10 @@ struct gfs2_glock {
|
||||||
struct delayed_work gl_work;
|
struct delayed_work gl_work;
|
||||||
union {
|
union {
|
||||||
/* For iopen glocks only */
|
/* For iopen glocks only */
|
||||||
|
struct {
|
||||||
struct delayed_work gl_delete;
|
struct delayed_work gl_delete;
|
||||||
|
u64 gl_no_formal_ino;
|
||||||
|
};
|
||||||
/* For rgrp glocks only */
|
/* For rgrp glocks only */
|
||||||
struct {
|
struct {
|
||||||
loff_t start;
|
loff_t start;
|
||||||
|
|
Loading…
Reference in a new issue