Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196261
b: refs/heads/master
c: 52a9ee2
h: refs/heads/master
i:
  196259: 8ac7f42
v: v3
  • Loading branch information
Jan Kara committed May 21, 2010
1 parent 16668f9 commit 13090dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 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: 741e128933448e589a85286e535078b24f4cf568
refs/heads/master: 52a9ee281cfb26fffce1d6c409fb4b1f4aa8a766
17 changes: 5 additions & 12 deletions trunk/fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
struct ocfs2_super *osb = OCFS2_SB(sb);
struct buffer_head *bh = NULL;
handle_t *handle = NULL;
int qtype;
struct dquot *transfer_from[MAXQUOTAS] = { };
struct dquot *transfer_to[MAXQUOTAS] = { };
int qtype;

mlog_entry("(0x%p, '%.*s')\n", dentry,
dentry->d_name.len, dentry->d_name.name);
Expand Down Expand Up @@ -1019,9 +1018,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
OCFS2_FEATURE_RO_COMPAT_USRQUOTA)) {
transfer_to[USRQUOTA] = dqget(sb, attr->ia_uid,
USRQUOTA);
transfer_from[USRQUOTA] = dqget(sb, inode->i_uid,
USRQUOTA);
if (!transfer_to[USRQUOTA] || !transfer_from[USRQUOTA]) {
if (!transfer_to[USRQUOTA]) {
status = -ESRCH;
goto bail_unlock;
}
Expand All @@ -1031,9 +1028,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
OCFS2_FEATURE_RO_COMPAT_GRPQUOTA)) {
transfer_to[GRPQUOTA] = dqget(sb, attr->ia_gid,
GRPQUOTA);
transfer_from[GRPQUOTA] = dqget(sb, inode->i_gid,
GRPQUOTA);
if (!transfer_to[GRPQUOTA] || !transfer_from[GRPQUOTA]) {
if (!transfer_to[GRPQUOTA]) {
status = -ESRCH;
goto bail_unlock;
}
Expand All @@ -1045,7 +1040,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
mlog_errno(status);
goto bail_unlock;
}
status = dquot_transfer(inode, attr);
status = __dquot_transfer(inode, transfer_to);
if (status < 0)
goto bail_commit;
} else {
Expand Down Expand Up @@ -1085,10 +1080,8 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr)
brelse(bh);

/* Release quota pointers in case we acquired them */
for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
for (qtype = 0; qtype < MAXQUOTAS; qtype++)
dqput(transfer_to[qtype]);
dqput(transfer_from[qtype]);
}

if (!status && attr->ia_valid & ATTR_MODE) {
status = ocfs2_acl_chmod(inode);
Expand Down

0 comments on commit 13090dc

Please sign in to comment.