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


Groups > linux.kernel > #1456366 > unrolled thread

[PATCH 1/2] f2fs: allow copying file range only in between regular files

Started byChao Yu <yuchao0@huawei.com>
First post2016-08-04 14:20 +0200
Last post2016-08-04 14:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] f2fs: allow copying file range only in between regular files Chao Yu <yuchao0@huawei.com> - 2016-08-04 14:20 +0200

#1456366 — [PATCH 1/2] f2fs: allow copying file range only in between regular files

FromChao Yu <yuchao0@huawei.com>
Date2016-08-04 14:20 +0200
Subject[PATCH 1/2] f2fs: allow copying file range only in between regular files
Message-ID<s2pMZ-qc-3@gated-at.bofh.it>
Only if two input files are regular files, we allow copying data in
range of them, otherwise, deny it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 fs/f2fs/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index be81722..409f0ec 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -2162,8 +2162,8 @@ static int f2fs_move_file_range(struct file *file_in, loff_t pos_in,
 	if (unlikely(f2fs_readonly(src->i_sb)))
 		return -EROFS;
 
-	if (S_ISDIR(src->i_mode) || S_ISDIR(dst->i_mode))
-		return -EISDIR;
+	if (!S_ISREG(src->i_mode) || !S_ISREG(dst->i_mode))
+		return -EINVAL;
 
 	if (f2fs_encrypted_inode(src) || f2fs_encrypted_inode(dst))
 		return -EOPNOTSUPP;
-- 
2.8.2.311.gee88674

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web