Skip to contentSkip to conversation

f2fs: don't allow volatile writes for non-regular file

PATCH RESEND New Chao Yu 1 participant 1 message Mar 17, 2017 F2FS file system

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH RESEND 1/1 f2fs: don't allow volatile writes for non-regular file

Now f2fs only supports volatile writes for journal db regular file.

---
 fs/f2fs/file.c | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/file.c +3 -0
index f64475a53ad8..f544a1648313 100644
@@ -1594,6 +1594,9 @@ static int f2fs_ioc_start_volatile_write(struct file *filp)
 	if (!inode_owner_or_capable(inode))
 		return -EACCES;
 
+	if (!S_ISREG(inode->i_mode))
+		return -EINVAL;
+
 	ret = mnt_want_write_file(filp);
 	if (ret)
 		return ret;
Signature · 6 lines
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