Skip to contentSkip to conversation

+ ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Sep 26, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

Subject: + ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
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 <[email protected]>
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()").

---

 fs/ocfs2/move_extents.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
fs/ocfs2/move_extents.c renamed from fs/ocfs2/move_extents.c~ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents +6 -2
diff -puN fs/ocfs2/move_extents.c~ocfs2-add-missing-errno-in-ocfs2_ioctl_move_extents 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 [email protected] 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