diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 2f733e7cea6b..666a2da755ca 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1412,7 +1412,7 @@ static int f2fs_write_data_pages(struct address_space *mapping, diff = nr_pages_to_write(sbi, DATA, wbc); - if (!S_ISDIR(inode->i_mode)) { + if (!S_ISDIR(inode->i_mode) && wbc->sync_mode == WB_SYNC_ALL) { mutex_lock(&sbi->writepages); locked = true; }