Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83455
b: refs/heads/master
c: 941d238
h: refs/heads/master
i:
  83453: 4912f45
  83451: 481d08a
  83447: b3bb315
  83439: 891af32
  83423: f28ac45
  83391: 12674d5
  83327: e1a0a8d
  83199: c9fbca1
  82943: 2f1e9e6
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Feb 6, 2008
1 parent fd0e875 commit f3ddd42
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bed9759b2e6bd938097389f6bd2ac8d622fa3884
refs/heads/master: 941d2380e979dfefb6c824452e9f42be3ef948ee
15 changes: 10 additions & 5 deletions trunk/fs/dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,8 @@ static int dqinit_needed(struct inode *inode, int type)
/* This routine is guarded by dqonoff_mutex mutex */
static void add_dquot_ref(struct super_block *sb, int type)
{
struct inode *inode;
struct inode *inode, *old_inode = NULL;

restart:
spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (!atomic_read(&inode->i_writecount))
Expand All @@ -711,12 +710,18 @@ static void add_dquot_ref(struct super_block *sb, int type)
__iget(inode);
spin_unlock(&inode_lock);

iput(old_inode);
sb->dq_op->initialize(inode, type);
iput(inode);
/* As we may have blocked we had better restart... */
goto restart;
/* We hold a reference to 'inode' so it couldn't have been
* removed from s_inodes list while we dropped the inode_lock.
* We cannot iput the inode now as we can be holding the last
* reference and we cannot iput it under inode_lock. So we
* keep the reference and iput it later. */
old_inode = inode;
spin_lock(&inode_lock);
}
spin_unlock(&inode_lock);
iput(old_inode);
}

/* Return 0 if dqput() won't block (note that 1 doesn't necessarily mean blocking) */
Expand Down

0 comments on commit f3ddd42

Please sign in to comment.