Unverified Commit 36c1a71a authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 0945ccf5 ac72dfd3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,13 @@ int f2fs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
				return err;
		}

		/*
		 * wait for inflight dio, blocks should be removed after
		 * IO completion.
		 */
		if (attr->ia_size < old_size)
			inode_dio_wait(inode);

		f2fs_down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]);
		filemap_invalidate_lock(inode->i_mapping);

@@ -1869,6 +1876,12 @@ static long f2fs_fallocate(struct file *file, int mode,
	if (ret)
		goto out;

	/*
	 * wait for inflight dio, blocks should be removed after IO
	 * completion.
	 */
	inode_dio_wait(inode);

	if (mode & FALLOC_FL_PUNCH_HOLE) {
		if (offset >= inode->i_size)
			goto out;