Skip to content

Commit

Permalink
Merge tag 'gfs2-v6.3-fix' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/gfs2/linux-gfs2

Pull gfs2 fix from Andreas Gruenbacher:

 - Fix a NULL pointer dereference when mounting corrupted filesystems

* tag 'gfs2-v6.3-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
  gfs2: Don't deref jdesc in evict
  • Loading branch information
Linus Torvalds committed May 10, 2023
2 parents ad2fd53 + 504a10d commit 2a78769
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/gfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,14 @@ static void gfs2_evict_inode(struct inode *inode)
if (inode->i_nlink || sb_rdonly(sb) || !ip->i_no_addr)
goto out;

/*
* In case of an incomplete mount, gfs2_evict_inode() may be called for
* system files without having an active journal to write to. In that
* case, skip the filesystem evict.
*/
if (!sdp->sd_jdesc)
goto out;

gfs2_holder_mark_uninitialized(&gh);
ret = evict_should_delete(inode, &gh);
if (ret == SHOULD_DEFER_EVICTION)
Expand Down

0 comments on commit 2a78769

Please sign in to comment.