Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit57c720d

Browse files
pavelmachektorvalds
authored andcommitted
ocfs2: fix unbalanced locking
Based on what fails, function can return with nfs_sync_rwlock eitherlocked or unlocked. That can not be right.Always return with lock unlocked on error.Fixes:4cd9973 ("ocfs2: avoid inode removal while nfsd is accessing it")Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>Signed-off-by: Andrew Morton <akpm@linux-foundation.org>Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>Reviewed-by: Andrew Morton <akpm@linux-foundation.org>Cc: Mark Fasheh <mark@fasheh.com>Cc: Joel Becker <jlbec@evilplan.org>Cc: Junxiao Bi <junxiao.bi@oracle.com>Cc: Changwei Ge <gechangwei@live.cn>Cc: Gang He <ghe@suse.com>Cc: Jun Piao <piaojun@huawei.com>Link:http://lkml.kernel.org/r/20200724124443.GA28164@duo.ucw.czSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent4510a5a commit57c720d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎fs/ocfs2/dlmglue.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2871,9 +2871,15 @@ int ocfs2_nfs_sync_lock(struct ocfs2_super *osb, int ex)
28712871

28722872
status=ocfs2_cluster_lock(osb,lockres,ex ?LKM_EXMODE :LKM_PRMODE,
28732873
0,0);
2874-
if (status<0)
2874+
if (status<0) {
28752875
mlog(ML_ERROR,"lock on nfs sync lock failed %d\n",status);
28762876

2877+
if (ex)
2878+
up_write(&osb->nfs_sync_rwlock);
2879+
else
2880+
up_read(&osb->nfs_sync_rwlock);
2881+
}
2882+
28772883
returnstatus;
28782884
}
28792885

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp