Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1602991 > unrolled thread

[PATCH 2/2] f2fs: don't allow atomic writes for not regular files

Started byJaegeuk Kim <jaegeuk@kernel.org>
First post2017-03-17 03:20 +0100
Last post2017-03-17 14:10 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] f2fs: don't allow atomic writes for not regular files Jaegeuk Kim <jaegeuk@kernel.org> - 2017-03-17 03:20 +0100
    Re: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not  regular files Chao Yu <yuchao0@huawei.com> - 2017-03-17 04:30 +0100
      Re: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not  regular files Jaegeuk Kim <jaegeuk@kernel.org> - 2017-03-17 14:10 +0100

#1602991 — [PATCH 2/2] f2fs: don't allow atomic writes for not regular files

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-03-17 03:20 +0100
Subject[PATCH 2/2] f2fs: don't allow atomic writes for not regular files
Message-ID<tlPEK-7s9-3@gated-at.bofh.it>
The atomic writes only supports regular files for database.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/file.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index da6d33d1bb34..d486e02b43c2 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1522,6 +1522,9 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
 	if (f2fs_is_atomic_file(inode))
 		goto out;
 
+	if (!S_ISREG(inode->i_mode))
+		return -EINVAL;
+
 	ret = f2fs_convert_inline_inode(inode);
 	if (ret)
 		goto out;
-- 
2.11.0

[toc] | [next] | [standalone]


#1603009 — Re: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not regular files

FromChao Yu <yuchao0@huawei.com>
Date2017-03-17 04:30 +0100
SubjectRe: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not regular files
Message-ID<tlQKu-8g6-7@gated-at.bofh.it>
In reply to#1602991
On 2017/3/17 10:09, Jaegeuk Kim wrote:
> The atomic writes only supports regular files for database.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/file.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> index da6d33d1bb34..d486e02b43c2 100644
> --- a/fs/f2fs/file.c
> +++ b/fs/f2fs/file.c
> @@ -1522,6 +1522,9 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
>  	if (f2fs_is_atomic_file(inode))
>  		goto out;
>  
> +	if (!S_ISREG(inode->i_mode))
> +		return -EINVAL;

goto out;

Thanks,

> +
>  	ret = f2fs_convert_inline_inode(inode);
>  	if (ret)
>  		goto out;
> 

[toc] | [prev] | [next] | [standalone]


#1603297 — Re: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not regular files

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-03-17 14:10 +0100
SubjectRe: [f2fs-dev] [PATCH 2/2] f2fs: don't allow atomic writes for not regular files
Message-ID<tlZNM-6Td-11@gated-at.bofh.it>
In reply to#1603009
On 03/17, Chao Yu wrote:
> On 2017/3/17 10:09, Jaegeuk Kim wrote:
> > The atomic writes only supports regular files for database.
> > 
> > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > ---
> >  fs/f2fs/file.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
> > index da6d33d1bb34..d486e02b43c2 100644
> > --- a/fs/f2fs/file.c
> > +++ b/fs/f2fs/file.c
> > @@ -1522,6 +1522,9 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
> >  	if (f2fs_is_atomic_file(inode))
> >  		goto out;
> >  
> > +	if (!S_ISREG(inode->i_mode))
> > +		return -EINVAL;
> 
> goto out;

Oh, I just move it to the beginning of the function.

Thanks,

> 
> Thanks,
> 
> > +
> >  	ret = f2fs_convert_inline_inode(inode);
> >  	if (ret)
> >  		goto out;
> > 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web