Skip to content

Commit 0ec9b9e

Browse files
author
Andreas Gruenbacher
committed
gfs2: Check for active reservation in gfs2_release
In gfs2_release, check if the inode has an active reservation to avoid unnecessary lock taking. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent b259896 commit 0ec9b9e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/gfs2/file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,10 +716,10 @@ static int gfs2_release(struct inode *inode, struct file *file)
716716
kfree(file->private_data);
717717
file->private_data = NULL;
718718

719-
if (file->f_mode & FMODE_WRITE) {
719+
if (gfs2_rs_active(&ip->i_res))
720720
gfs2_rs_delete(ip, &inode->i_writecount);
721+
if (file->f_mode & FMODE_WRITE)
721722
gfs2_qa_put(ip);
722-
}
723723
return 0;
724724
}
725725

0 commit comments

Comments
 (0)