lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200107101946.0b505f6a@canb.auug.org.au>
Date:   Tue, 7 Jan 2020 10:19:46 +1100
From:   Stephen Rothwell <sfr@...b.auug.org.au>
To:     "Darrick J. Wong" <darrick.wong@...cle.com>,
        Jaegeuk Kim <jaegeuk@...nel.org>
Cc:     Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andreas Gruenbacher <agruenba@...hat.com>,
        Chao Yu <yuchao0@...wei.com>
Subject: linux-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 */

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ