The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, David Howells <dhowells@redhat.com>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	GNU/Weeb Mailing List <gwml@vger.gnuweeb.org>,
	linux-kernel@vger.kernel.org
Subject: [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 35/40] fs/netfs/buffered_write.c:793 netfs_page_mkwrite() error: uninitialized symbol 'spare_region'.
Date: Tue, 5 Apr 2022 14:43:43 +0300	[thread overview]
Message-ID: <202204051945.mr2bveSZ-lkp@intel.com> (raw)

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head:   674eea41fc70a740ff83ec590f9833f805852464
commit: fc20927bc9709523b2a53feee2a52423b9d66456 [35/40] netfs: Allow buffered shared-writeable mmap through netfs_page_mkwrite()
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220405/202204051945.mr2bveSZ-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
fs/netfs/buffered_write.c:793 netfs_page_mkwrite() error: uninitialized symbol 'spare_region'.

vim +/spare_region +793 fs/netfs/buffered_write.c

fc20927bc97095 David Howells 2022-02-15  732  vm_fault_t netfs_page_mkwrite(struct vm_fault *vmf)
fc20927bc97095 David Howells 2022-02-15  733  {
fc20927bc97095 David Howells 2022-02-15  734  	struct netfs_dirty_region *spare_region;
fc20927bc97095 David Howells 2022-02-15  735  	struct folio *folio = page_folio(vmf->page);
fc20927bc97095 David Howells 2022-02-15  736  	struct file *file = vmf->vma->vm_file;
fc20927bc97095 David Howells 2022-02-15  737  	struct inode *inode = file_inode(file);
fc20927bc97095 David Howells 2022-02-15  738  	struct netfs_i_context *ctx = netfs_i_context(inode);
fc20927bc97095 David Howells 2022-02-15  739  	vm_fault_t ret = VM_FAULT_RETRY;
fc20927bc97095 David Howells 2022-02-15  740  	int err;
fc20927bc97095 David Howells 2022-02-15  741  
fc20927bc97095 David Howells 2022-02-15  742  	MA_STATE(mas, &ctx->dirty_regions, vmf->page->index, PAGE_SIZE);
fc20927bc97095 David Howells 2022-02-15  743  
fc20927bc97095 David Howells 2022-02-15  744  	_enter("%lx", folio->index);
fc20927bc97095 David Howells 2022-02-15  745  
fc20927bc97095 David Howells 2022-02-15  746  	if (ctx->ops->validate_for_write(inode, file) < 0)
fc20927bc97095 David Howells 2022-02-15  747  		return VM_FAULT_SIGBUS;
fc20927bc97095 David Howells 2022-02-15  748  
fc20927bc97095 David Howells 2022-02-15  749  	sb_start_pagefault(inode->i_sb);
fc20927bc97095 David Howells 2022-02-15  750  
fc20927bc97095 David Howells 2022-02-15  751  	if (folio_wait_writeback_killable(folio))
fc20927bc97095 David Howells 2022-02-15  752  		goto out;
fc20927bc97095 David Howells 2022-02-15  753  
fc20927bc97095 David Howells 2022-02-15  754  	if (folio_lock_killable(folio) < 0)
fc20927bc97095 David Howells 2022-02-15  755  		goto out;
fc20927bc97095 David Howells 2022-02-15  756  
fc20927bc97095 David Howells 2022-02-15  757  	if (mas_expected_entries(&mas, 2) < 0) {
fc20927bc97095 David Howells 2022-02-15  758  		ret = VM_FAULT_OOM;
fc20927bc97095 David Howells 2022-02-15  759  		goto out;

Lot's of goto out before "sparse_region" is set.

fc20927bc97095 David Howells 2022-02-15  760  	}
fc20927bc97095 David Howells 2022-02-15  761  
fc20927bc97095 David Howells 2022-02-15  762  	spare_region = netfs_alloc_dirty_region();
fc20927bc97095 David Howells 2022-02-15  763  	if (IS_ERR(spare_region)) {
fc20927bc97095 David Howells 2022-02-15  764  		ret = VM_FAULT_OOM;
fc20927bc97095 David Howells 2022-02-15  765  		goto out;
fc20927bc97095 David Howells 2022-02-15  766  	}
fc20927bc97095 David Howells 2022-02-15  767  
fc20927bc97095 David Howells 2022-02-15  768  	err = netfs_flush_conflicting_writes(ctx, file, folio_pos(folio),
fc20927bc97095 David Howells 2022-02-15  769  					     folio_size(folio), folio);
fc20927bc97095 David Howells 2022-02-15  770  	switch (err) {
fc20927bc97095 David Howells 2022-02-15  771  	case 0:
fc20927bc97095 David Howells 2022-02-15  772  		break;
fc20927bc97095 David Howells 2022-02-15  773  	case -EAGAIN:
fc20927bc97095 David Howells 2022-02-15  774  		ret = VM_FAULT_RETRY;
fc20927bc97095 David Howells 2022-02-15  775  		goto out;
fc20927bc97095 David Howells 2022-02-15  776  	case -ENOMEM:
fc20927bc97095 David Howells 2022-02-15  777  		ret = VM_FAULT_OOM;
fc20927bc97095 David Howells 2022-02-15  778  		goto out;
fc20927bc97095 David Howells 2022-02-15  779  	default:
fc20927bc97095 David Howells 2022-02-15  780  		ret = VM_FAULT_SIGBUS;
fc20927bc97095 David Howells 2022-02-15  781  		goto out;
fc20927bc97095 David Howells 2022-02-15  782  	}
fc20927bc97095 David Howells 2022-02-15  783  
fc20927bc97095 David Howells 2022-02-15  784  	netfs_commit_folio(ctx, file, &spare_region, &mas,
fc20927bc97095 David Howells 2022-02-15  785  			   folio, 0, folio_size(folio));
fc20927bc97095 David Howells 2022-02-15  786  	netfs_commit_region(ctx, &mas, folio_pos(folio), folio_size(folio));
fc20927bc97095 David Howells 2022-02-15  787  	file_update_time(file);
fc20927bc97095 David Howells 2022-02-15  788  
fc20927bc97095 David Howells 2022-02-15  789  	ret = VM_FAULT_LOCKED;
fc20927bc97095 David Howells 2022-02-15  790  out:
fc20927bc97095 David Howells 2022-02-15  791  	sb_end_pagefault(inode->i_sb);
fc20927bc97095 David Howells 2022-02-15  792  	mas_destroy(&mas);
fc20927bc97095 David Howells 2022-02-15 @793  	netfs_put_dirty_region(ctx, spare_region, netfs_region_trace_put_discard);
                                                                            ^^^^^^^^^^^^

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


                 reply	other threads:[~2022-04-06  1:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202204051945.mr2bveSZ-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=dhowells@redhat.com \
    --cc=gwml@vger.gnuweeb.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox