diff options
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b91b0e10678e..1e1aae669fa8 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -1513,6 +1513,7 @@ static int f2fs_write_data_pages(struct address_space *mapping, | |||
1513 | { | 1513 | { |
1514 | struct inode *inode = mapping->host; | 1514 | struct inode *inode = mapping->host; |
1515 | struct f2fs_sb_info *sbi = F2FS_I_SB(inode); | 1515 | struct f2fs_sb_info *sbi = F2FS_I_SB(inode); |
1516 | bool locked = false; | ||
1516 | int ret; | 1517 | int ret; |
1517 | long diff; | 1518 | long diff; |
1518 | 1519 | ||
@@ -1533,7 +1534,13 @@ static int f2fs_write_data_pages(struct address_space *mapping, | |||
1533 | 1534 | ||
1534 | diff = nr_pages_to_write(sbi, DATA, wbc); | 1535 | diff = nr_pages_to_write(sbi, DATA, wbc); |
1535 | 1536 | ||
1537 | if (!S_ISDIR(inode->i_mode)) { | ||
1538 | mutex_lock(&sbi->writepages); | ||
1539 | locked = true; | ||
1540 | } | ||
1536 | ret = write_cache_pages(mapping, wbc, __f2fs_writepage, mapping); | 1541 | ret = write_cache_pages(mapping, wbc, __f2fs_writepage, mapping); |
1542 | if (locked) | ||
1543 | mutex_unlock(&sbi->writepages); | ||
1537 | 1544 | ||
1538 | f2fs_submit_merged_bio(sbi, DATA, WRITE); | 1545 | f2fs_submit_merged_bio(sbi, DATA, WRITE); |
1539 | 1546 | ||