Skip to content

Commit

Permalink
gfs2: Check for active reservation in gfs2_release
Browse files Browse the repository at this point in the history
In gfs2_release, check if the inode has an active reservation to avoid
unnecessary lock taking.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
  • Loading branch information
Andreas Gruenbacher committed Feb 17, 2021
1 parent b259896 commit 0ec9b9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/gfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,10 @@ static int gfs2_release(struct inode *inode, struct file *file)
kfree(file->private_data);
file->private_data = NULL;

if (file->f_mode & FMODE_WRITE) {
if (gfs2_rs_active(&ip->i_res))
gfs2_rs_delete(ip, &inode->i_writecount);
if (file->f_mode & FMODE_WRITE)
gfs2_qa_put(ip);
}
return 0;
}

Expand Down

0 comments on commit 0ec9b9e

Please sign in to comment.