fs: point out any processes using O_PONIES From: Josef 'Jeff' Sipek Signed-off-by: Josef 'Jeff' Sipek diff --git a/fs/open.c b/fs/open.c index a3a78ce..e162a6e 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1039,6 +1039,9 @@ long do_sys_open(int dfd, const char __user *filename, int flags, int mode) } else { fsnotify_open(f->f_path.dentry); fd_install(fd, f); + if (flags & O_PONIES) + printk(KERN_WARNING "'%s' uses O_PONIES\n", + current->comm); } } putname(tmp); diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h index b847741..9648af4 100644 --- a/include/asm-generic/fcntl.h +++ b/include/asm-generic/fcntl.h @@ -51,6 +51,9 @@ #ifndef O_CLOEXEC #define O_CLOEXEC 02000000 /* set close_on_exec */ #endif +#ifndef O_PONIES +#define O_PONIES 04000000 /* unreasonable fs assumptions */ +#endif #ifndef O_NDELAY #define O_NDELAY O_NONBLOCK #endif