Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1603016 > unrolled thread
| Started by | Chao Yu <yuchao0@huawei.com> |
|---|---|
| First post | 2017-03-17 04:40 +0100 |
| Last post | 2017-03-20 12:10 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] f2fs: don't allow volatile writes for non-regular file Chao Yu <yuchao0@huawei.com> - 2017-03-17 04:40 +0100
Re: [PATCH] f2fs: don't allow volatile writes for non-regular file kbuild test robot <lkp@intel.com> - 2017-03-19 17:10 +0100
Re: [PATCH] f2fs: don't allow volatile writes for non-regular file Chao Yu <yuchao0@huawei.com> - 2017-03-20 12:10 +0100
| From | Chao Yu <yuchao0@huawei.com> |
|---|---|
| Date | 2017-03-17 04:40 +0100 |
| Subject | [PATCH] f2fs: don't allow volatile writes for non-regular file |
| Message-ID | <tlQUa-8mg-21@gated-at.bofh.it> |
Now f2fs only supports volatile writes for journal db regular file. Signed-off-by: Chao Yu <yuchao0@huawei.com> --- fs/f2fs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index d486e02b43c2..e090d34f732d 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1593,6 +1593,9 @@ static int f2fs_ioc_start_volatile_write(struct file *filp) if (!inode_owner_or_capable(inode)) return -EACCES; + if (!S_ISREG(inode)) + return -EINVAL; + ret = mnt_want_write_file(filp); if (ret) return ret; -- 2.8.2.295.g3f1c1d0
[toc] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2017-03-19 17:10 +0100 |
| Message-ID | <tmLz4-89I-17@gated-at.bofh.it> |
| In reply to | #1603016 |
Hi Chao,
[auto build test WARNING on f2fs/dev]
[also build test WARNING on v4.11-rc2 next-20170310]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-don-t-allow-volatile-writes-for-non-regular-file/20170319-221605
base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
include/linux/compiler.h:264:8: sparse: attribute 'no_sanitize_address': unknown attribute
>> fs/f2fs/file.c:1598:14: sparse: incompatible types for operation (&)
fs/f2fs/file.c:1598:14: left side has type struct inode *inode
fs/f2fs/file.c:1598:14: right side has type int
fs/f2fs/file.c:1598:14: sparse: incompatible types for operation (==)
fs/f2fs/file.c:1598:14: left side has type bad type
fs/f2fs/file.c:1598:14: right side has type int
In file included from include/linux/stat.h:6:0,
from include/linux/fs.h:9,
from fs/f2fs/file.c:11:
fs/f2fs/file.c: In function 'f2fs_ioc_start_volatile_write':
include/uapi/linux/stat.h:20:26: error: invalid operands to binary & (have 'struct inode *' and 'int')
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
^
fs/f2fs/file.c:1598:7: note: in expansion of macro 'S_ISREG'
if (!S_ISREG(inode))
^~~~~~~
vim +1598 fs/f2fs/file.c
1582 ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
1583 }
1584 err_out:
1585 inode_unlock(inode);
1586 mnt_drop_write_file(filp);
1587 return ret;
1588 }
1589
1590 static int f2fs_ioc_start_volatile_write(struct file *filp)
1591 {
1592 struct inode *inode = file_inode(filp);
1593 int ret;
1594
1595 if (!inode_owner_or_capable(inode))
1596 return -EACCES;
1597
> 1598 if (!S_ISREG(inode))
1599 return -EINVAL;
1600
1601 ret = mnt_want_write_file(filp);
1602 if (ret)
1603 return ret;
1604
1605 inode_lock(inode);
1606
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [next] | [standalone]
| From | Chao Yu <yuchao0@huawei.com> |
|---|---|
| Date | 2017-03-20 12:10 +0100 |
| Message-ID | <tn3mi-3Qx-17@gated-at.bofh.it> |
| In reply to | #1604022 |
Hello,
Sorry for my mistaken, have fixed and resent the patch.
[PATCH RESEND] f2fs: don't allow volatile writes for non-regular file
Thanks,
On 2017/3/20 0:00, kbuild test robot wrote:
> Hi Chao,
>
> [auto build test WARNING on f2fs/dev]
> [also build test WARNING on v4.11-rc2 next-20170310]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url: https://github.com/0day-ci/linux/commits/Chao-Yu/f2fs-don-t-allow-volatile-writes-for-non-regular-file/20170319-221605
> base: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git dev
> reproduce:
> # apt-get install sparse
> make ARCH=x86_64 allmodconfig
> make C=1 CF=-D__CHECK_ENDIAN__
>
>
> sparse warnings: (new ones prefixed by >>)
>
> include/linux/compiler.h:264:8: sparse: attribute 'no_sanitize_address': unknown attribute
>>> fs/f2fs/file.c:1598:14: sparse: incompatible types for operation (&)
> fs/f2fs/file.c:1598:14: left side has type struct inode *inode
> fs/f2fs/file.c:1598:14: right side has type int
> fs/f2fs/file.c:1598:14: sparse: incompatible types for operation (==)
> fs/f2fs/file.c:1598:14: left side has type bad type
> fs/f2fs/file.c:1598:14: right side has type int
> In file included from include/linux/stat.h:6:0,
> from include/linux/fs.h:9,
> from fs/f2fs/file.c:11:
> fs/f2fs/file.c: In function 'f2fs_ioc_start_volatile_write':
> include/uapi/linux/stat.h:20:26: error: invalid operands to binary & (have 'struct inode *' and 'int')
> #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
> ^
> fs/f2fs/file.c:1598:7: note: in expansion of macro 'S_ISREG'
> if (!S_ISREG(inode))
> ^~~~~~~
>
> vim +1598 fs/f2fs/file.c
>
> 1582 ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
> 1583 }
> 1584 err_out:
> 1585 inode_unlock(inode);
> 1586 mnt_drop_write_file(filp);
> 1587 return ret;
> 1588 }
> 1589
> 1590 static int f2fs_ioc_start_volatile_write(struct file *filp)
> 1591 {
> 1592 struct inode *inode = file_inode(filp);
> 1593 int ret;
> 1594
> 1595 if (!inode_owner_or_capable(inode))
> 1596 return -EACCES;
> 1597
>> 1598 if (!S_ISREG(inode))
> 1599 return -EINVAL;
> 1600
> 1601 ret = mnt_want_write_file(filp);
> 1602 if (ret)
> 1603 return ret;
> 1604
> 1605 inode_lock(inode);
> 1606
>
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all Intel Corporation
>
> .
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web