From e4e1249bd911132d9c193589b98741a1f58c1ccb Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 13 May 2009 17:02:50 +0000 Subject: [PATCH] --- yaml --- r: 150321 b: refs/heads/master c: 496a60cdcd5d0d884dddf6c3b4ea912923a70f13 h: refs/heads/master i: 150319: 086d575f9bf32e295c2d89e02aed029d6c5eb9d4 v: v3 --- [refs] | 2 +- trunk/drivers/net/bonding/bond_sysfs.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 6de79a119e94..0c170166d89f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 26574401fef6766f6c3ca25b5c13febe662d2a32 +refs/heads/master: 496a60cdcd5d0d884dddf6c3b4ea912923a70f13 diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c index d28731535226..3a1b7b04eb79 100644 --- a/trunk/drivers/net/bonding/bond_sysfs.c +++ b/trunk/drivers/net/bonding/bond_sysfs.c @@ -251,7 +251,8 @@ static ssize_t bonding_store_slaves(struct device *d, /* Note: We can't hold bond->lock here, as bond_create grabs it. */ - rtnl_lock(); + if (!rtnl_trylock()) + return restart_syscall(); down_write(&(bonding_rwsem)); sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ @@ -1171,7 +1172,8 @@ static ssize_t bonding_store_primary(struct device *d, struct slave *slave; struct bonding *bond = to_bond(d); - rtnl_lock(); + if (!rtnl_trylock()) + return restart_syscall(); read_lock(&bond->lock); write_lock_bh(&bond->curr_slave_lock); @@ -1288,7 +1290,8 @@ static ssize_t bonding_store_active_slave(struct device *d, struct slave *new_active = NULL; struct bonding *bond = to_bond(d); - rtnl_lock(); + if (!rtnl_trylock()) + return restart_syscall(); read_lock(&bond->lock); write_lock_bh(&bond->curr_slave_lock);