Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286647
b: refs/heads/master
c: 34b0784
h: refs/heads/master
i:
  286645: 539dda4
  286643: 526a1a2
  286639: df49513
v: v3
  • Loading branch information
Djalal Harouni authored and Jan Kara committed Jan 11, 2012
1 parent b92229f commit 2ee9eea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 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: 353b67d8ced4dc53281c88150ad295e24bc4b4c5
refs/heads/master: 34b07840565004cfa444e165e88bf77a5cbcdb25
22 changes: 16 additions & 6 deletions trunk/fs/ext2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,41 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
flags = flags & EXT2_FL_USER_MODIFIABLE;
flags |= oldflags & ~EXT2_FL_USER_MODIFIABLE;
ei->i_flags = flags;
mutex_unlock(&inode->i_mutex);

ext2_set_inode_flags(inode);
inode->i_ctime = CURRENT_TIME_SEC;
mutex_unlock(&inode->i_mutex);

mark_inode_dirty(inode);
setflags_out:
mnt_drop_write_file(filp);
return ret;
}
case EXT2_IOC_GETVERSION:
return put_user(inode->i_generation, (int __user *) arg);
case EXT2_IOC_SETVERSION:
case EXT2_IOC_SETVERSION: {
__u32 generation;

if (!inode_owner_or_capable(inode))
return -EPERM;
ret = mnt_want_write_file(filp);
if (ret)
return ret;
if (get_user(inode->i_generation, (int __user *) arg)) {
if (get_user(generation, (int __user *) arg)) {
ret = -EFAULT;
} else {
inode->i_ctime = CURRENT_TIME_SEC;
mark_inode_dirty(inode);
goto setversion_out;
}

mutex_lock(&inode->i_mutex);
inode->i_ctime = CURRENT_TIME_SEC;
inode->i_generation = generation;
mutex_unlock(&inode->i_mutex);

mark_inode_dirty(inode);
setversion_out:
mnt_drop_write_file(filp);
return ret;
}
case EXT2_IOC_GETRSVSZ:
if (test_opt(inode->i_sb, RESERVATION)
&& S_ISREG(inode->i_mode)
Expand Down

0 comments on commit 2ee9eea

Please sign in to comment.