mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
quota: Refactor dquot_transfer code so that OCFS2 can pass in its references
Currently, __dquot_transfer() acquires its own references of dquot structures that will be put into inode. But for OCFS2, this creates a lock inversion between dq_lock (waited on in dqget) and transaction start (started in ocfs2_setattr). Currently, deadlock is impossible because dq_lock is acquired only during dquot_acquire and dquot_release and we already hold a reference to dquot structures in ocfs2_setattr so neither of these functions can be called while we call dquot_transfer. But this is rather subtle and it is hard to teach lockdep about it. So provide __dquot_transfer function that can be passed dquot references directly. OCFS2 can then pass acquired dquot references directly to __dquot_transfer with proper locking. Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
12755627bd
commit
bc8e5f0739
2 changed files with 27 additions and 35 deletions
|
@ -76,6 +76,7 @@ int vfs_get_dqblk(struct super_block *sb, int type, qid_t id,
|
|||
int vfs_set_dqblk(struct super_block *sb, int type, qid_t id,
|
||||
struct fs_disk_quota *di);
|
||||
|
||||
int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
|
||||
int dquot_transfer(struct inode *inode, struct iattr *iattr);
|
||||
int vfs_dq_quota_on_remount(struct super_block *sb);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue