* [PATCH] f2fs: don't allow volatile writes for non-regular file
@ 2017-03-17 3:32 ` Chao Yu
0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-03-17 3:32 UTC (permalink / raw)
To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, chao, Chao Yu
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] f2fs: don't allow volatile writes for non-regular file
@ 2017-03-17 3:32 ` Chao Yu
0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-03-17 3:32 UTC (permalink / raw)
To: jaegeuk; +Cc: chao, linux-kernel, linux-f2fs-devel
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
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] f2fs: don't allow volatile writes for non-regular file
2017-03-17 3:32 ` Chao Yu
@ 2017-03-19 16:00 ` kbuild test robot
-1 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-03-19 16:00 UTC (permalink / raw)
To: Chao Yu
Cc: kbuild-all, jaegeuk, linux-f2fs-devel, linux-kernel, chao, Chao Yu
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] f2fs: don't allow volatile writes for non-regular file
@ 2017-03-19 16:00 ` kbuild test robot
0 siblings, 0 replies; 6+ messages in thread
From: kbuild test robot @ 2017-03-19 16:00 UTC (permalink / raw)
To: Chao Yu; +Cc: chao, linux-kernel, linux-f2fs-devel, kbuild-all, jaegeuk
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
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] f2fs: don't allow volatile writes for non-regular file
2017-03-19 16:00 ` kbuild test robot
@ 2017-03-20 10:56 ` Chao Yu
-1 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-03-20 10:56 UTC (permalink / raw)
To: kbuild test robot
Cc: kbuild-all, jaegeuk, linux-f2fs-devel, linux-kernel, chao
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
>
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] f2fs: don't allow volatile writes for non-regular file
@ 2017-03-20 10:56 ` Chao Yu
0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2017-03-20 10:56 UTC (permalink / raw)
To: kbuild test robot
Cc: jaegeuk, chao, kbuild-all, linux-kernel, linux-f2fs-devel
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
>
> .
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-03-20 11:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-17 3:32 [PATCH] f2fs: don't allow volatile writes for non-regular file Chao Yu
2017-03-17 3:32 ` Chao Yu
2017-03-19 16:00 ` kbuild test robot
2017-03-19 16:00 ` kbuild test robot
2017-03-20 10:56 ` Chao Yu
2017-03-20 10:56 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.