ocfs2-devel.oss.oracle.com archive mirror
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] Ocfs2: do not allow fallocate on dir file
@ 2011-03-04  7:10 Li Dongyang
  2011-03-04  8:21 ` Tristan Ye
  2011-03-09 23:01 ` Mark Fasheh
  0 siblings, 2 replies; 10+ messages in thread
From: Li Dongyang @ 2011-03-04  7:10 UTC (permalink / raw)
  To: ocfs2-devel

allowing fallocate() on dir file doesn't make sense, we check if
we are dealing with a regular file and return -EINVAL when it's not,
Thanks

Signed-off-by: Li Dongyang <lidongyang@novell.com>
---
 fs/ocfs2/file.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index a665195..0c68a61 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1870,6 +1870,11 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
 		goto out_inode_unlock;
 	}
 
+	if (!S_ISREG(inode->i_mode)) {
+		ret = -EINVAL;
+		goto out_inode_unlock;
+	}
+
 	switch (sr->l_whence) {
 	case 0: /*SEEK_SET*/
 		break;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-03-10 21:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-04  7:10 [Ocfs2-devel] [PATCH] Ocfs2: do not allow fallocate on dir file Li Dongyang
2011-03-04  8:21 ` Tristan Ye
2011-03-09 23:01 ` Mark Fasheh
2011-03-10  2:27   ` Sunil Mushran
2011-03-10  2:46     ` Tao Ma
2011-03-10  4:25       ` Mark Fasheh
2011-03-10  6:00         ` Jiaju Zhang
2011-03-10 16:54           ` Mark Fasheh
2011-03-10 18:33             ` Jiaju Zhang
2011-03-10 21:21               ` Mark Fasheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).