All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 2/2] f2fs: don't allow atomic writes for not regular files
Date: Fri, 17 Mar 2017 10:09:06 +0800	[thread overview]
Message-ID: <20170317020906.28165-2-jaegeuk@kernel.org> (raw)
In-Reply-To: <20170317020906.28165-1-jaegeuk@kernel.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 2/2] f2fs: don't allow atomic writes for not regular files
Date: Fri, 17 Mar 2017 10:09:06 +0800	[thread overview]
Message-ID: <20170317020906.28165-2-jaegeuk@kernel.org> (raw)
In-Reply-To: <20170317020906.28165-1-jaegeuk@kernel.org>

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

  reply	other threads:[~2017-03-17  2:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17  2:09 [PATCH 1/2] f2fs: fix stale ATOMIC_WRITTEN_PAGE private pointer Jaegeuk Kim
2017-03-17  2:09 ` Jaegeuk Kim
2017-03-17  2:09 ` Jaegeuk Kim [this message]
2017-03-17  2:09   ` [PATCH 2/2] f2fs: don't allow atomic writes for not regular files Jaegeuk Kim
2017-03-17  3:23   ` [f2fs-dev] " Chao Yu
2017-03-17  3:23     ` Chao Yu
2017-03-17 12:40     ` [f2fs-dev] " Jaegeuk Kim
2017-03-17 12:40       ` Jaegeuk Kim
2017-03-17  6:51 ` [f2fs-dev] [PATCH 1/2] f2fs: fix stale ATOMIC_WRITTEN_PAGE private pointer Chao Yu
2017-03-17  6:51   ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170317020906.28165-2-jaegeuk@kernel.org \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.