Skip to contentSkip to conversation

ocfs2: ocfs2 punch hole retrun EINVAL if the length argument in ioctl is negative

PATCH New Tariq Saeed 1 participant 1 message Dec 20, 2013 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: ocfs2 punch hole retrun EINVAL if the length argument in ioctl is negative

Orabug:14789508

An unreserve space ioctl OCFS2_IOC_UNRESVSP/64 should reject a negative length.

---
 fs/ocfs2/file.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/ocfs2/file.c +2 -1
index 3261d71..408086e 100644
@@ -1873,7 +1873,8 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
 	}
 	size = sr->l_start + sr->l_len;
 
-	if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64) {
+	if (cmd == OCFS2_IOC_RESVSP || cmd == OCFS2_IOC_RESVSP64 ||
+	    cmd == OCFS2_IOC_UNRESVSP || cmd == OCFS2_IOC_UNRESVSP64) {
 		if (sr->l_len <= 0) {
 			ret = -EINVAL;
 			goto out_inode_unlock;
Signature · 1 line
1.7.1