Commit ed0994da authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] dquot_transfer() fix

From: Jan Kara <jack@suse.cz>

I'm sending a fix which fixes potential problems (dropping references which
were not acquired) when dquot_transfer() fails.
parent c47b7971
...@@ -1011,9 +1011,12 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr) ...@@ -1011,9 +1011,12 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
spin_unlock(&dq_data_lock); spin_unlock(&dq_data_lock);
flush_warnings(transfer_to, warntype); flush_warnings(transfer_to, warntype);
for (cnt = 0; cnt < MAXQUOTAS; cnt++) for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
if (transfer_from[cnt] != NODQUOT) if (ret == QUOTA_OK && transfer_from[cnt] != NODQUOT)
dqput(transfer_from[cnt]); dqput(transfer_from[cnt]);
if (ret == NO_QUOTA && transfer_to[cnt] != NODQUOT)
dqput(transfer_to[cnt]);
}
up_write(&sb_dqopt(inode->i_sb)->dqptr_sem); up_write(&sb_dqopt(inode->i_sb)->dqptr_sem);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment