Re: [PATCH] fcntl: allow to set O_DIRECT flag on pipe

From: kbuild test robot
Date: Tue Dec 15 2015 - 11:16:49 EST


Hi Stanislav,

[auto build test WARNING on v4.4-rc5]
[also build test WARNING on next-20151215]

url: https://github.com/0day-ci/linux/commits/Stanislav-Kinsburskiy/fcntl-allow-to-set-O_DIRECT-flag-on-pipe/20151216-000234
config: i386-randconfig-x009-12141102 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

All warnings (new ones prefixed by >>):

In file included from include/uapi/linux/stddef.h:1:0,
from include/linux/stddef.h:4,
from include/uapi/linux/posix_types.h:4,
from include/uapi/linux/types.h:13,
from include/linux/types.h:5,
from include/linux/syscalls.h:70,
from fs/fcntl.c:7:
fs/fcntl.c: In function 'setfl':
fs/fcntl.c:55:7: error: implicit declaration of function 'IS_FIFO' [-Werror=implicit-function-declaration]
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> fs/fcntl.c:55:2: note: in expansion of macro 'if'
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
fs/fcntl.c:55:15: error: 'f' undeclared (first use in this function)
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> fs/fcntl.c:55:2: note: in expansion of macro 'if'
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
fs/fcntl.c:55:15: note: each undeclared identifier is reported only once for each function it appears in
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
include/linux/compiler.h:147:28: note: in definition of macro '__trace_if'
if (__builtin_constant_p((cond)) ? !!(cond) : \
^
>> fs/fcntl.c:55:2: note: in expansion of macro 'if'
if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
^
cc1: some warnings being treated as errors

vim +/if +55 fs/fcntl.c

1 /*
2 * linux/fs/fcntl.c
3 *
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 */
6
> 7 #include <linux/syscalls.h>
8 #include <linux/init.h>
9 #include <linux/mm.h>
10 #include <linux/fs.h>
11 #include <linux/file.h>
12 #include <linux/fdtable.h>
13 #include <linux/capability.h>
14 #include <linux/dnotify.h>
15 #include <linux/slab.h>
16 #include <linux/module.h>
17 #include <linux/pipe_fs_i.h>
18 #include <linux/security.h>
19 #include <linux/ptrace.h>
20 #include <linux/signal.h>
21 #include <linux/rcupdate.h>
22 #include <linux/pid_namespace.h>
23 #include <linux/user_namespace.h>
24 #include <linux/shmem_fs.h>
25
26 #include <asm/poll.h>
27 #include <asm/siginfo.h>
28 #include <asm/uaccess.h>
29
30 #define SETFL_MASK (O_APPEND | O_NONBLOCK | O_NDELAY | O_DIRECT | O_NOATIME)
31
32 static int setfl(int fd, struct file * filp, unsigned long arg)
33 {
34 struct inode * inode = file_inode(filp);
35 int error = 0;
36
37 /*
38 * O_APPEND cannot be cleared if the file is marked as append-only
39 * and the file is open for write.
40 */
41 if (((arg ^ filp->f_flags) & O_APPEND) && IS_APPEND(inode))
42 return -EPERM;
43
44 /* O_NOATIME can only be set by the owner or superuser */
45 if ((arg & O_NOATIME) && !(filp->f_flags & O_NOATIME))
46 if (!inode_owner_or_capable(inode))
47 return -EPERM;
48
49 /* required for strict SunOS emulation */
50 if (O_NONBLOCK != O_NDELAY)
51 if (arg & O_NDELAY)
52 arg |= O_NONBLOCK;
53
54 /* Pipe packetized mode is controlled by O_DIRECT flag */
> 55 if (!IS_FIFO(f->f_mode) && (arg & O_DIRECT)) {
56 if (!filp->f_mapping || !filp->f_mapping->a_ops ||
57 !filp->f_mapping->a_ops->direct_IO)
58 return -EINVAL;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

Attachment: .config.gz
Description: Binary data