linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [vfs:work.open2 30/38] fs/namei.c:2669:2: error: expected statement before ']' token
@ 2018-07-10 13:34 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2018-07-10 13:34 UTC (permalink / raw)
  To: Al Viro; +Cc: kbuild-all, linux-fsdevel

[-- Attachment #1: Type: text/plain, Size: 31214 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.open2
head:   ccb7c63aa12c5bbd07e8d39cdea7ff4bfad7bc94
commit: 8bf89c7ad09394ab021d40fe0d0b064158589a84 [30/38] make path_init() unconditionally paired with terminate_walk()
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout 8bf89c7ad09394ab021d40fe0d0b064158589a84
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: the vfs/work.open2 HEAD ccb7c63aa12c5bbd07e8d39cdea7ff4bfad7bc94 builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   fs/namei.c: In function 'path_mountpoint':
>> fs/namei.c:2669:2: error: expected statement before ']' token
     ]
     ^
>> fs/namei.c:2689:1: error: invalid storage class for function 'filename_mountpoint'
    filename_mountpoint(int dfd, struct filename *name, struct path *path,
    ^~~~~~~~~~~~~~~~~~~
>> fs/namei.c:2688:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    static int
    ^~~~~~
   fs/namei.c:2738:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    int __check_sticky(struct inode *dir, struct inode *inode)
    ^~~
>> fs/namei.c:2770:12: error: invalid storage class for function 'may_delete'
    static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
               ^~~~~~~~~~
   fs/namei.c:2770:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
    ^~~~~~
>> fs/namei.c:2819:19: error: invalid storage class for function 'may_create'
    static inline int may_create(struct inode *dir, struct dentry *child)
                      ^~~~~~~~~~
   fs/namei.c:2868:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    void unlock_rename(struct dentry *p1, struct dentry *p2)
    ^~~~
   fs/namei.c:2878:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
    ^~~
   fs/namei.c:2899:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    int vfs_mkobj(struct dentry *dentry, umode_t mode,
    ^~~
   fs/namei.c:2920:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    bool may_open_dev(const struct path *path)
    ^~~~
>> fs/namei.c:2926:12: error: invalid storage class for function 'may_open'
    static int may_open(const struct path *path, int acc_mode, int flag)
               ^~~~~~~~
>> fs/namei.c:2974:12: error: invalid storage class for function 'handle_truncate'
    static int handle_truncate(struct file *filp)
               ^~~~~~~~~~~~~~~
>> fs/namei.c:2996:19: error: invalid storage class for function 'open_to_namei_flags'
    static inline int open_to_namei_flags(int flag)
                      ^~~~~~~~~~~~~~~~~~~
>> fs/namei.c:3003:12: error: invalid storage class for function 'may_o_create'
    static int may_o_create(const struct path *dir, struct dentry *dentry, umode_t mode)
               ^~~~~~~~~~~~
>> fs/namei.c:3035:12: error: invalid storage class for function 'atomic_open'
    static int atomic_open(struct nameidata *nd, struct dentry *dentry,
               ^~~~~~~~~~~
>> fs/namei.c:3107:12: error: invalid storage class for function 'lookup_open'
    static int lookup_open(struct nameidata *nd, struct path *path,
               ^~~~~~~~~~~
>> fs/namei.c:3237:12: error: invalid storage class for function 'do_last'
    static int do_last(struct nameidata *nd,
               ^~~~~~~
>> fs/namei.c:3447:12: error: invalid storage class for function 'do_tmpfile'
    static int do_tmpfile(struct nameidata *nd, unsigned flags,
               ^~~~~~~~~~
   fs/namei.c:3447:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    static int do_tmpfile(struct nameidata *nd, unsigned flags,
    ^~~~~~
>> fs/namei.c:3479:12: error: invalid storage class for function 'do_o_path'
    static int do_o_path(struct nameidata *nd, unsigned flags, struct file *file)
               ^~~~~~~~~
>> fs/namei.c:3491:21: error: invalid storage class for function 'path_openat'
    static struct file *path_openat(struct nameidata *nd,
                        ^~~~~~~~~~~
>> fs/namei.c:3596:23: error: invalid storage class for function 'filename_create'
    static struct dentry *filename_create(int dfd, struct filename *name,
                          ^~~~~~~~~~~~~~~
   fs/namei.c:3675:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    void done_path_create(struct path *path, struct dentry *dentry)
    ^~~~
   In file included from include/linux/compiler_types.h:58:0,
                    from <command-line>:0:
   include/linux/compiler-gcc.h:83:16: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    #define inline inline  __attribute__((unused)) notrace
                   ^
   fs/namei.c:3684:1: note: in expansion of macro 'inline'
    inline struct dentry *user_path_create(int dfd, const char __user *pathname,
    ^~~~~~
   fs/namei.c:3691:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev)
    ^~~
>> fs/namei.c:3720:12: error: invalid storage class for function 'may_mknod'
    static int may_mknod(umode_t mode)
               ^~~~~~~~~
   fs/namei.c:3720:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    static int may_mknod(umode_t mode)
    ^~~~~~
>> fs/namei.c:3781:1: warning: 'alias' attribute ignored [-Wattributes]
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   In file included from fs/namei.c:29:0:
   include/linux/syscalls.h:237:21: error: invalid storage class for function '__do_sys_mknodat'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:237:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:239:18: error: static declaration of '__se_sys_mknodat' follows non-static declaration
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:238:18: note: previous declaration of '__se_sys_mknodat' was here
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function '__se_sys_mknodat':
   include/linux/syscalls.h:241:14: error: implicit declaration of function '__do_sys_mknodat'; did you mean '__se_sys_mknodat'? [-Werror=implicit-function-declaration]
      long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
                 ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function 'path_mountpoint':
   include/linux/syscalls.h:246:21: error: invalid storage class for function '__do_sys_mknodat'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3781:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(mknodat, int, dfd, const char __user *, filename, umode_t, mode,
    ^~~~~~~~~~~~~~~
   fs/namei.c:3787:1: warning: 'alias' attribute ignored [-Wattributes]
    SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
    ^~~~~~~~~~~~~~~
   In file included from fs/namei.c:29:0:
   include/linux/syscalls.h:237:21: error: invalid storage class for function '__do_sys_mknod'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:214:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE3(name, ...) SYSCALL_DEFINEx(3, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:3787:1: note: in expansion of macro 'SYSCALL_DEFINE3'
    SYSCALL_DEFINE3(mknod, const char __user *, filename, umode_t, mode, unsigned, dev)
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:237:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:214:36: note: in expansion of macro 'SYSCALL_DEFINEx'
--
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4324:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function 'path_mountpoint':
   include/linux/syscalls.h:246:21: error: invalid storage class for function '__do_sys_linkat'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4324:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(linkat, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: warning: 'alias' attribute ignored [-Wattributes]
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   In file included from fs/namei.c:29:0:
   include/linux/syscalls.h:237:21: error: invalid storage class for function '__do_sys_link'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:237:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:239:18: error: static declaration of '__se_sys_link' follows non-static declaration
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:238:18: note: previous declaration of '__se_sys_link' was here
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function '__se_sys_link':
   include/linux/syscalls.h:241:14: error: implicit declaration of function '__do_sys_link'; did you mean '__se_sys_link'? [-Werror=implicit-function-declaration]
      long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
                 ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function 'path_mountpoint':
   include/linux/syscalls.h:246:21: error: invalid storage class for function '__do_sys_link'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:213:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE2(name, ...) SYSCALL_DEFINEx(2, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4330:1: note: in expansion of macro 'SYSCALL_DEFINE2'
    SYSCALL_DEFINE2(link, const char __user *, oldname, const char __user *, newname)
    ^~~~~~~~~~~~~~~
>> fs/namei.c:4510:12: error: invalid storage class for function 'do_renameat2'
    static int do_renameat2(int olddfd, const char __user *oldname, int newdfd,
               ^~~~~~~~~~~~
   fs/namei.c:4510:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
    static int do_renameat2(int olddfd, const char __user *oldname, int newdfd,
    ^~~~~~
   fs/namei.c:4653:1: warning: 'alias' attribute ignored [-Wattributes]
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   In file included from fs/namei.c:29:0:
   include/linux/syscalls.h:237:21: error: invalid storage class for function '__do_sys_renameat2'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:237:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:239:18: error: static declaration of '__se_sys_renameat2' follows non-static declaration
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:238:18: note: previous declaration of '__se_sys_renameat2' was here
     asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
                     ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function '__se_sys_renameat2':
   include/linux/syscalls.h:241:14: error: implicit declaration of function '__do_sys_renameat2'; did you mean '__se_sys_renameat2'? [-Werror=implicit-function-declaration]
      long ret = __do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
                 ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   fs/namei.c: In function 'path_mountpoint':
   include/linux/syscalls.h:246:21: error: invalid storage class for function '__do_sys_renameat2'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:216:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE5(name, ...) SYSCALL_DEFINEx(5, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4653:1: note: in expansion of macro 'SYSCALL_DEFINE5'
    SYSCALL_DEFINE5(renameat2, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   fs/namei.c:4659:1: warning: 'alias' attribute ignored [-Wattributes]
    SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   In file included from fs/namei.c:29:0:
   include/linux/syscalls.h:237:21: error: invalid storage class for function '__do_sys_renameat'
     static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
                        ^
   include/linux/syscalls.h:223:2: note: in expansion of macro '__SYSCALL_DEFINEx'
     __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
     ^~~~~~~~~~~~~~~~~
   include/linux/syscalls.h:215:36: note: in expansion of macro 'SYSCALL_DEFINEx'
    #define SYSCALL_DEFINE4(name, ...) SYSCALL_DEFINEx(4, _##name, __VA_ARGS__)
                                       ^~~~~~~~~~~~~~~
   fs/namei.c:4659:1: note: in expansion of macro 'SYSCALL_DEFINE4'
    SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname,
    ^~~~~~~~~~~~~~~
   include/linux/syscalls.h:237:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
..

vim +2669 fs/namei.c

  2651	
  2652	/**
  2653	 * path_mountpoint - look up a path to be umounted
  2654	 * @nd:		lookup context
  2655	 * @flags:	lookup flags
  2656	 * @path:	pointer to container for result
  2657	 *
  2658	 * Look up the given name, but don't attempt to revalidate the last component.
  2659	 * Returns 0 and "path" will be valid on success; Returns error otherwise.
  2660	 */
  2661	static int
  2662	path_mountpoint(struct nameidata *nd, unsigned flags, struct path *path)
  2663	{
  2664		const char *s = path_init(nd, flags);
  2665		int err;
  2666		if (IS_ERR(s)) {
  2667			terminate_walk(nd);
  2668			return PTR_ERR(s);
> 2669		]
  2670		while (!(err = link_path_walk(s, nd)) &&
  2671			(err = mountpoint_last(nd)) > 0) {
  2672			s = trailing_symlink(nd);
  2673			if (IS_ERR(s)) {
  2674				err = PTR_ERR(s);
  2675				break;
  2676			}
  2677		}
  2678		if (!err) {
  2679			*path = nd->path;
  2680			nd->path.mnt = NULL;
  2681			nd->path.dentry = NULL;
  2682			follow_mount(path);
  2683		}
  2684		terminate_walk(nd);
  2685		return err;
  2686	}
  2687	
> 2688	static int
> 2689	filename_mountpoint(int dfd, struct filename *name, struct path *path,
  2690				unsigned int flags)
  2691	{
  2692		struct nameidata nd;
  2693		int error;
  2694		if (IS_ERR(name))
  2695			return PTR_ERR(name);
  2696		set_nameidata(&nd, dfd, name);
  2697		error = path_mountpoint(&nd, flags | LOOKUP_RCU, path);
  2698		if (unlikely(error == -ECHILD))
  2699			error = path_mountpoint(&nd, flags, path);
  2700		if (unlikely(error == -ESTALE))
  2701			error = path_mountpoint(&nd, flags | LOOKUP_REVAL, path);
  2702		if (likely(!error))
  2703			audit_inode(name, path->dentry, 0);
  2704		restore_nameidata();
  2705		putname(name);
  2706		return error;
  2707	}
  2708	
  2709	/**
  2710	 * user_path_mountpoint_at - lookup a path from userland in order to umount it
  2711	 * @dfd:	directory file descriptor
  2712	 * @name:	pathname from userland
  2713	 * @flags:	lookup flags
  2714	 * @path:	pointer to container to hold result
  2715	 *
  2716	 * A umount is a special case for path walking. We're not actually interested
  2717	 * in the inode in this situation, and ESTALE errors can be a problem. We
  2718	 * simply want track down the dentry and vfsmount attached at the mountpoint
  2719	 * and avoid revalidating the last component.
  2720	 *
  2721	 * Returns 0 and populates "path" on success.
  2722	 */
  2723	int
  2724	user_path_mountpoint_at(int dfd, const char __user *name, unsigned int flags,
  2725				struct path *path)
  2726	{
  2727		return filename_mountpoint(dfd, getname(name), path, flags);
  2728	}
  2729	
  2730	int
  2731	kern_path_mountpoint(int dfd, const char *name, struct path *path,
  2732				unsigned int flags)
  2733	{
  2734		return filename_mountpoint(dfd, getname_kernel(name), path, flags);
  2735	}
  2736	EXPORT_SYMBOL(kern_path_mountpoint);
  2737	
> 2738	int __check_sticky(struct inode *dir, struct inode *inode)
  2739	{
  2740		kuid_t fsuid = current_fsuid();
  2741	
  2742		if (uid_eq(inode->i_uid, fsuid))
  2743			return 0;
  2744		if (uid_eq(dir->i_uid, fsuid))
  2745			return 0;
  2746		return !capable_wrt_inode_uidgid(inode, CAP_FOWNER);
  2747	}
  2748	EXPORT_SYMBOL(__check_sticky);
  2749	
  2750	/*
  2751	 *	Check whether we can remove a link victim from directory dir, check
  2752	 *  whether the type of victim is right.
  2753	 *  1. We can't do it if dir is read-only (done in permission())
  2754	 *  2. We should have write and exec permissions on dir
  2755	 *  3. We can't remove anything from append-only dir
  2756	 *  4. We can't do anything with immutable dir (done in permission())
  2757	 *  5. If the sticky bit on dir is set we should either
  2758	 *	a. be owner of dir, or
  2759	 *	b. be owner of victim, or
  2760	 *	c. have CAP_FOWNER capability
  2761	 *  6. If the victim is append-only or immutable we can't do antyhing with
  2762	 *     links pointing to it.
  2763	 *  7. If the victim has an unknown uid or gid we can't change the inode.
  2764	 *  8. If we were asked to remove a directory and victim isn't one - ENOTDIR.
  2765	 *  9. If we were asked to remove a non-directory and victim isn't one - EISDIR.
  2766	 * 10. We can't remove a root or mountpoint.
  2767	 * 11. We don't allow removal of NFS sillyrenamed files; it's handled by
  2768	 *     nfs_async_unlink().
  2769	 */
> 2770	static int may_delete(struct inode *dir, struct dentry *victim, bool isdir)
  2771	{
  2772		struct inode *inode = d_backing_inode(victim);
  2773		int error;
  2774	
  2775		if (d_is_negative(victim))
  2776			return -ENOENT;
  2777		BUG_ON(!inode);
  2778	
  2779		BUG_ON(victim->d_parent->d_inode != dir);
  2780	
  2781		/* Inode writeback is not safe when the uid or gid are invalid. */
  2782		if (!uid_valid(inode->i_uid) || !gid_valid(inode->i_gid))
  2783			return -EOVERFLOW;
  2784	
  2785		audit_inode_child(dir, victim, AUDIT_TYPE_CHILD_DELETE);
  2786	
  2787		error = inode_permission(dir, MAY_WRITE | MAY_EXEC);
  2788		if (error)
  2789			return error;
  2790		if (IS_APPEND(dir))
  2791			return -EPERM;
  2792	
  2793		if (check_sticky(dir, inode) || IS_APPEND(inode) ||
  2794		    IS_IMMUTABLE(inode) || IS_SWAPFILE(inode) || HAS_UNMAPPED_ID(inode))
  2795			return -EPERM;
  2796		if (isdir) {
  2797			if (!d_is_dir(victim))
  2798				return -ENOTDIR;
  2799			if (IS_ROOT(victim))
  2800				return -EBUSY;
  2801		} else if (d_is_dir(victim))
  2802			return -EISDIR;
  2803		if (IS_DEADDIR(dir))
  2804			return -ENOENT;
  2805		if (victim->d_flags & DCACHE_NFSFS_RENAMED)
  2806			return -EBUSY;
  2807		return 0;
  2808	}
  2809	
  2810	/*	Check whether we can create an object with dentry child in directory
  2811	 *  dir.
  2812	 *  1. We can't do it if child already exists (open has special treatment for
  2813	 *     this case, but since we are inlined it's OK)
  2814	 *  2. We can't do it if dir is read-only (done in permission())
  2815	 *  3. We can't do it if the fs can't represent the fsuid or fsgid.
  2816	 *  4. We should have write and exec permissions on dir
  2817	 *  5. We can't do it if dir is immutable (done in permission())
  2818	 */
> 2819	static inline int may_create(struct inode *dir, struct dentry *child)
  2820	{
  2821		struct user_namespace *s_user_ns;
  2822		audit_inode_child(dir, child, AUDIT_TYPE_CHILD_CREATE);
  2823		if (child->d_inode)
  2824			return -EEXIST;
  2825		if (IS_DEADDIR(dir))
  2826			return -ENOENT;
  2827		s_user_ns = dir->i_sb->s_user_ns;
  2828		if (!kuid_has_mapping(s_user_ns, current_fsuid()) ||
  2829		    !kgid_has_mapping(s_user_ns, current_fsgid()))
  2830			return -EOVERFLOW;
  2831		return inode_permission(dir, MAY_WRITE | MAY_EXEC);
  2832	}
  2833	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6370 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-07-10 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 13:34 [vfs:work.open2 30/38] fs/namei.c:2669:2: error: expected statement before ']' token kbuild test robot

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).