ext4 defrag executables
PATCH 1/1 ext4 defrag executables
hi,
since ioctl EXT4_IOC_MOVE_EXT checks the original file descriptor for write access it's no longer possible to defrag executable files which are currently in use. This is because you can only open() those files readonly. This patch solves it without adding a security hole.
What do you think about it?
Andreas
fs/ext4/ioctl.c +2 -2
@@ -242,8 +242,8 @@ setversion_out:struct file *donor_filp;int err; -if (!(filp->f_mode &FMODE_READ ) || - !(filp->f_mode &FMODE_WRITE )) +if (generic_permission (filp->f_dentry->d_inode, +MAY_READ |MAY_WRITE ,NULL ))return -EBADF ; if (copy_from_user(&me,