Project

General

Profile

Actions

Tasks #1112

closed

check all igrab at ceph-client,remove deadlock : spin_lock(&inode->i_lock) + igrab(inode)

Added by changping Wu almost 13 years ago. Updated almost 13 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
fs/ceph
Target version:
% Done:

0%

Tags:
Reviewed:
Affected Versions:

Description

Hi , at igrab function,it has existed the codes: spin_lock(&inode->i_lock);
if coding this:

spin_lock(&inode->i_lock);
...................
igrab(inode);
.................
spin_unlock(&inode->i_lock);

it is a deadlock.

Jeff ,Wu

linux-2.6.39:
http://lxr.linux.no/#linux+v2.6.39/fs/inode.c#L1144

1143
1144struct inode igrab(struct inode *inode)
1145{
1146 spin_lock(&inode->i_lock);
1147 if (!(inode->i_state & (I_FREEING|I_WILL_FREE))) {
1148 __iget(inode);
1149 spin_unlock(&inode->i_lock);
1150 } else {
1151 spin_unlock(&inode->i_lock);
1152 /

1153 * Handle the case where s_op->clear_inode is not been
1154 * called yet, and somebody is calling igrab
1155 * while the inode is getting freed.
1156 */
1157 inode = NULL;
1158 }
1159 return inode;
1160}
1161EXPORT_SYMBOL(igrab);


Files

ceph-client__fsstress_log1 (94.1 KB) ceph-client__fsstress_log1 changping Wu, 05/27/2011 08:00 AM
ceph-client_fsstress_log2 (48.4 KB) ceph-client_fsstress_log2 changping Wu, 05/27/2011 08:00 AM
ceph-client_fsstress_log3 (31.1 KB) ceph-client_fsstress_log3 changping Wu, 05/27/2011 08:00 AM
Actions

Also available in: Atom PDF