|
@@ -1254,6 +1254,14 @@ out:
|
|
|
|
|
|
static int f2fs_release_file(struct inode *inode, struct file *filp)
|
|
|
{
|
|
|
+ /*
|
|
|
+ * f2fs_relase_file is called at every close calls. So we should
|
|
|
+ * not drop any inmemory pages by close called by other process.
|
|
|
+ */
|
|
|
+ if (!(filp->f_mode & FMODE_WRITE) ||
|
|
|
+ atomic_read(&inode->i_writecount) != 1)
|
|
|
+ return 0;
|
|
|
+
|
|
|
/* some remained atomic pages should discarded */
|
|
|
if (f2fs_is_atomic_file(inode))
|
|
|
drop_inmem_pages(inode);
|