lkml.org 
[lkml]   [2020]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectlinux-next: manual merge of the iomap tree with the f2fs tree
Hi all,

Today's linux-next merge of the iomap tree got a conflict in:

fs/f2fs/file.c

between commits:

bdf032992489 ("f2fs: call f2fs_balance_fs outside of locked page")
df4d07124128 ("f2fs: support data compression")

from the f2fs tree and commit:

4a58d8158f6d ("fs: Fix page_mkwrite off-by-one errors")

from the iomap tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc fs/f2fs/file.c
index bde5612f37f5,0e77b2e6f873..000000000000
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@@ -50,9 -50,8 +50,10 @@@ static vm_fault_t f2fs_vm_page_mkwrite(
struct page *page = vmf->page;
struct inode *inode = file_inode(vmf->vma->vm_file);
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
- struct dnode_of_data dn = { .node_changed = false };
- int offset, err;
+ struct dnode_of_data dn;
+ bool need_alloc = true;
+ int err = 0;
++ int offset;

if (unlikely(f2fs_cp_error(sbi))) {
err = -EIO;
@@@ -88,25 -70,24 +89,26 @@@
file_update_time(vmf->vma->vm_file);
down_read(&F2FS_I(inode)->i_mmap_sem);
lock_page(page);
- if (unlikely(page->mapping != inode->i_mapping ||
- page_offset(page) > i_size_read(inode) ||
- !PageUptodate(page))) {
+ err = -EFAULT;
+ if (likely(PageUptodate(page)))
+ err = page_mkwrite_check_truncate(page, inode);
+ if (unlikely(err < 0)) {
unlock_page(page);
- err = -EFAULT;
goto out_sem;
}
+ offset = err;

- /* block allocation */
- __do_map_lock(sbi, F2FS_GET_BLOCK_PRE_AIO, true);
- set_new_dnode(&dn, inode, NULL, NULL, 0);
- err = f2fs_get_block(&dn, page->index);
- f2fs_put_dnode(&dn);
- __do_map_lock(sbi, F2FS_GET_BLOCK_PRE_AIO, false);
- if (err) {
- unlock_page(page);
- goto out_sem;
+ if (need_alloc) {
+ /* block allocation */
+ __do_map_lock(sbi, F2FS_GET_BLOCK_PRE_AIO, true);
+ set_new_dnode(&dn, inode, NULL, NULL, 0);
+ err = f2fs_get_block(&dn, page->index);
+ f2fs_put_dnode(&dn);
+ __do_map_lock(sbi, F2FS_GET_BLOCK_PRE_AIO, false);
+ if (err) {
+ unlock_page(page);
+ goto out_sem;
+ }
}

/* fill the page */
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2020-01-07 00:20    [W:0.074 / U:1.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site