Subject: + ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch added to -mm tree To: younger.liu@xxxxxxxxxx,dan.carpenter@xxxxxxxxxx,jeff.liu@xxxxxxxxxx,jlbec@xxxxxxxxxxxx,mfasheh@xxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Wed, 25 Sep 2013 17:38:17 -0700 The patch titled Subject: ocfs2: add missing errno in ocfs2_ioctl_move_extents() has been added to the -mm tree. Its filename is ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Younger Liu <younger.liu@xxxxxxxxxx> Subject: ocfs2: add missing errno in ocfs2_ioctl_move_extents() If the file is not regular or writeable, it should return errno(EPERM). This patch is based on 85a258b70d ("ocfs2: fix error handling in ocfs2_ioctl_move_extents()"). Signed-off-by: Younger Liu <younger.liu@xxxxxxxxxx> Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx> Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Reviewed-by: Jie Liu <jeff.liu@xxxxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/move_extents.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN fs/ocfs2/move_extents.c~ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents fs/ocfs2/move_extents.c --- a/fs/ocfs2/move_extents.c~ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents +++ a/fs/ocfs2/move_extents.c @@ -1066,8 +1066,10 @@ int ocfs2_ioctl_move_extents(struct file if (status) return status; - if ((!S_ISREG(inode->i_mode)) || !(filp->f_mode & FMODE_WRITE)) + if ((!S_ISREG(inode->i_mode)) || !(filp->f_mode & FMODE_WRITE)) { + status = -EPERM; goto out_drop; + } if (inode->i_flags & (S_IMMUTABLE|S_APPEND)) { status = -EPERM; @@ -1089,8 +1091,10 @@ int ocfs2_ioctl_move_extents(struct file goto out_free; } - if (range.me_start > i_size_read(inode)) + if (range.me_start > i_size_read(inode)) { + status = -EINVAL; goto out_free; + } if (range.me_start + range.me_len > i_size_read(inode)) range.me_len = i_size_read(inode) - range.me_start; _ Patches currently in -mm which might be from younger.liu@xxxxxxxxxx are ocfs2-rollback-transaction-in-ocfs2_group_add.patch ocfs2-do-not-call-brelse-if-group_bh-is-not-initialized-in-ocfs2_group_add.patch ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del.patch ocfs2-fix-issue-that-ocfs2_setattr-does-not-deal-with-new_i_size==i_size.patch ocfs2-update-inode-size-after-zeronig-the-hole.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html