From 012bb3e61e5eced6c610f9e036372bf0c8def2d1 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 5 Oct 2000 01:18:40 +0000 Subject: Merge with Linux 2.4.0-test9. Please check DECstation, I had a number of rejects to fixup while integrating Linus patches. I also found that this kernel will only boot SMP on Origin; the UP kernel freeze soon after bootup with SCSI timeout messages. I commit this anyway since I found that the last CVS versions had the same problem. --- fs/dquot.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'fs/dquot.c') diff --git a/fs/dquot.c b/fs/dquot.c index 2271f4746..ef1f15016 100644 --- a/fs/dquot.c +++ b/fs/dquot.c @@ -1213,14 +1213,6 @@ int dquot_transfer(struct dentry *dentry, struct iattr *iattr) return 0; lock_kernel(); - /* - * Find out if this filesystem uses i_blocks. - */ - if (!inode->i_sb->s_blocksize) - blocks = isize_to_blocks(inode->i_size, BLOCK_SIZE_BITS); - else - blocks = (inode->i_blocks >> 1); - /* * Build the transfer_from and transfer_to lists and check quotas to see * if operation is permitted. @@ -1280,14 +1272,29 @@ int dquot_transfer(struct dentry *dentry, struct iattr *iattr) * dqget() could block and so the first structure might got * invalidated or locked... */ - if (!transfer_to[cnt]->dq_sb || !transfer_from[cnt]->dq_sb || - check_idq(transfer_to[cnt], 1) == NO_QUOTA || - check_bdq(transfer_to[cnt], blocks, 0) == NO_QUOTA) { + if (!transfer_to[cnt]->dq_sb || !transfer_from[cnt]->dq_sb) { cnt++; goto put_all; } } + /* + * Find out if this filesystem uses i_blocks. + */ + if (!inode->i_sb->s_blocksize) + blocks = isize_to_blocks(inode->i_size, BLOCK_SIZE_BITS); + else + blocks = (inode->i_blocks >> 1); + for (cnt = 0; cnt < MAXQUOTAS; cnt++) { + if (!transfer_to[cnt]) + continue; + if (check_idq(transfer_to[cnt], 1) == NO_QUOTA || + check_bdq(transfer_to[cnt], blocks, 0) == NO_QUOTA) { + cnt = MAXQUOTAS; + goto put_all; + } + } + if ((error = notify_change(dentry, iattr))) goto put_all; /* -- cgit v1.2.3