All of lore.kernel.org
 help / color / mirror / Atom feed
* [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.
@ 2021-11-10  7:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2021-11-09 21:12 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6945 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: David Howells <dhowells@redhat.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-rewrite-indexing-2
head:   90bb44e5d6dcd202b7443fbe2dd1f71cd408b942
commit: 0cdb319c9ee8e62be3f3c395eabfd746515a8c9b [50/64] cachefiles: Implement the I/O routines
:::::: branch date: 3 weeks ago
:::::: commit date: 3 weeks ago
config: powerpc-randconfig-m031-20211101 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 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/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.

vim +/ret +483 fs/cachefiles/io.c

0cdb319c9ee8e6 David Howells 2021-10-21  420  
0cdb319c9ee8e6 David Howells 2021-10-21  421  /*
0cdb319c9ee8e6 David Howells 2021-10-21  422   * Prepare for a write to occur.
0cdb319c9ee8e6 David Howells 2021-10-21  423   */
0cdb319c9ee8e6 David Howells 2021-10-21  424  static int __cachefiles_prepare_write(struct netfs_cache_resources *cres,
0cdb319c9ee8e6 David Howells 2021-10-21  425  				      loff_t *_start, size_t *_len, loff_t i_size,
0cdb319c9ee8e6 David Howells 2021-10-21  426  				      bool no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  427  {
0cdb319c9ee8e6 David Howells 2021-10-21  428  	struct cachefiles_object *object = cachefiles_cres_object(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  429  	struct cachefiles_cache *cache = object->volume->cache;
0cdb319c9ee8e6 David Howells 2021-10-21  430  	struct file *file = cachefiles_cres_file(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  431  	loff_t start = *_start, pos;
0cdb319c9ee8e6 David Howells 2021-10-21  432  	size_t len = *_len, down;
0cdb319c9ee8e6 David Howells 2021-10-21  433  	int ret;
0cdb319c9ee8e6 David Howells 2021-10-21  434  
0cdb319c9ee8e6 David Howells 2021-10-21  435  	/* Round to DIO size */
0cdb319c9ee8e6 David Howells 2021-10-21  436  	down = start - round_down(start, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  437  	*_start = start - down;
0cdb319c9ee8e6 David Howells 2021-10-21  438  	*_len = round_up(down + len, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  439  
0cdb319c9ee8e6 David Howells 2021-10-21  440  	/* We need to work out whether there's sufficient disk space to perform
0cdb319c9ee8e6 David Howells 2021-10-21  441  	 * the write - but we can skip that check if we have space already
0cdb319c9ee8e6 David Howells 2021-10-21  442  	 * allocated.
0cdb319c9ee8e6 David Howells 2021-10-21  443  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  444  	if (no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  445  		goto check_space;
0cdb319c9ee8e6 David Howells 2021-10-21  446  
0cdb319c9ee8e6 David Howells 2021-10-21  447  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  448  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  449  		pos = vfs_llseek(file, *_start, SEEK_DATA);
0cdb319c9ee8e6 David Howells 2021-10-21  450  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  451  		if (pos == -ENXIO)
0cdb319c9ee8e6 David Howells 2021-10-21  452  			goto check_space; /* Unallocated tail */
0cdb319c9ee8e6 David Howells 2021-10-21  453  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  454  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  455  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  456  	}
0cdb319c9ee8e6 David Howells 2021-10-21  457  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  458  		goto check_space; /* Unallocated region */
0cdb319c9ee8e6 David Howells 2021-10-21  459  
0cdb319c9ee8e6 David Howells 2021-10-21  460  	/* We have a block that's at least partially filled - if we're low on
0cdb319c9ee8e6 David Howells 2021-10-21  461  	 * space, we need to see if it's fully allocated.  If it's not, we may
0cdb319c9ee8e6 David Howells 2021-10-21  462  	 * want to cull it.
0cdb319c9ee8e6 David Howells 2021-10-21  463  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  464  	if (cachefiles_has_space(cache, 0, *_len / PAGE_SIZE) == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  465  		return 0; /* Enough space to simply overwrite the whole block */
0cdb319c9ee8e6 David Howells 2021-10-21  466  
0cdb319c9ee8e6 David Howells 2021-10-21  467  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  468  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  469  		pos = vfs_llseek(file, *_start, SEEK_HOLE);
0cdb319c9ee8e6 David Howells 2021-10-21  470  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  471  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  472  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  473  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  474  	}
0cdb319c9ee8e6 David Howells 2021-10-21  475  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  476  		return 0; /* Fully allocated */
0cdb319c9ee8e6 David Howells 2021-10-21  477  
0cdb319c9ee8e6 David Howells 2021-10-21  478  	/* Partially allocated, but insufficient space: cull. */
0cdb319c9ee8e6 David Howells 2021-10-21  479  	pos = cachefiles_inject_remove_error();
0cdb319c9ee8e6 David Howells 2021-10-21  480  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  481  		ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
0cdb319c9ee8e6 David Howells 2021-10-21  482  				    *_start, *_len);
0cdb319c9ee8e6 David Howells 2021-10-21 @483  	if (ret < 0) {
0cdb319c9ee8e6 David Howells 2021-10-21  484  		trace_cachefiles_io_error(object, file_inode(file), ret,
0cdb319c9ee8e6 David Howells 2021-10-21  485  					  cachefiles_trace_fallocate_error);
0cdb319c9ee8e6 David Howells 2021-10-21  486  		cachefiles_io_error_obj(object,
0cdb319c9ee8e6 David Howells 2021-10-21  487  					"CacheFiles: fallocate failed (%d)\n", ret);
0cdb319c9ee8e6 David Howells 2021-10-21  488  		ret = -EIO;
0cdb319c9ee8e6 David Howells 2021-10-21  489  	}
0cdb319c9ee8e6 David Howells 2021-10-21  490  
0cdb319c9ee8e6 David Howells 2021-10-21  491  	return ret;
0cdb319c9ee8e6 David Howells 2021-10-21  492  
0cdb319c9ee8e6 David Howells 2021-10-21  493  check_space:
0cdb319c9ee8e6 David Howells 2021-10-21  494  	return cachefiles_has_space(cache, 0, *_len / PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  495  }
0cdb319c9ee8e6 David Howells 2021-10-21  496  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38078 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.
@ 2021-11-10  7:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-11-10  7:38 UTC (permalink / raw)
  To: kbuild, David Howells; +Cc: lkp, kbuild-all, linux-kernel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-rewrite-indexing-2
head:   90bb44e5d6dcd202b7443fbe2dd1f71cd408b942
commit: 0cdb319c9ee8e62be3f3c395eabfd746515a8c9b [50/64] cachefiles: Implement the I/O routines
config: powerpc-randconfig-m031-20211101 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 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/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.

vim +/ret +483 fs/cachefiles/io.c

0cdb319c9ee8e6 David Howells 2021-10-21  424  static int __cachefiles_prepare_write(struct netfs_cache_resources *cres,
0cdb319c9ee8e6 David Howells 2021-10-21  425  				      loff_t *_start, size_t *_len, loff_t i_size,
0cdb319c9ee8e6 David Howells 2021-10-21  426  				      bool no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  427  {
0cdb319c9ee8e6 David Howells 2021-10-21  428  	struct cachefiles_object *object = cachefiles_cres_object(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  429  	struct cachefiles_cache *cache = object->volume->cache;
0cdb319c9ee8e6 David Howells 2021-10-21  430  	struct file *file = cachefiles_cres_file(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  431  	loff_t start = *_start, pos;
0cdb319c9ee8e6 David Howells 2021-10-21  432  	size_t len = *_len, down;
0cdb319c9ee8e6 David Howells 2021-10-21  433  	int ret;
                                                ^^^^^^^^

0cdb319c9ee8e6 David Howells 2021-10-21  434  
0cdb319c9ee8e6 David Howells 2021-10-21  435  	/* Round to DIO size */
0cdb319c9ee8e6 David Howells 2021-10-21  436  	down = start - round_down(start, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  437  	*_start = start - down;
0cdb319c9ee8e6 David Howells 2021-10-21  438  	*_len = round_up(down + len, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  439  
0cdb319c9ee8e6 David Howells 2021-10-21  440  	/* We need to work out whether there's sufficient disk space to perform
0cdb319c9ee8e6 David Howells 2021-10-21  441  	 * the write - but we can skip that check if we have space already
0cdb319c9ee8e6 David Howells 2021-10-21  442  	 * allocated.
0cdb319c9ee8e6 David Howells 2021-10-21  443  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  444  	if (no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  445  		goto check_space;
0cdb319c9ee8e6 David Howells 2021-10-21  446  
0cdb319c9ee8e6 David Howells 2021-10-21  447  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  448  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  449  		pos = vfs_llseek(file, *_start, SEEK_DATA);
0cdb319c9ee8e6 David Howells 2021-10-21  450  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  451  		if (pos == -ENXIO)
0cdb319c9ee8e6 David Howells 2021-10-21  452  			goto check_space; /* Unallocated tail */
0cdb319c9ee8e6 David Howells 2021-10-21  453  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  454  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  455  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  456  	}
0cdb319c9ee8e6 David Howells 2021-10-21  457  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  458  		goto check_space; /* Unallocated region */
0cdb319c9ee8e6 David Howells 2021-10-21  459  
0cdb319c9ee8e6 David Howells 2021-10-21  460  	/* We have a block that's at least partially filled - if we're low on
0cdb319c9ee8e6 David Howells 2021-10-21  461  	 * space, we need to see if it's fully allocated.  If it's not, we may
0cdb319c9ee8e6 David Howells 2021-10-21  462  	 * want to cull it.
0cdb319c9ee8e6 David Howells 2021-10-21  463  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  464  	if (cachefiles_has_space(cache, 0, *_len / PAGE_SIZE) == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  465  		return 0; /* Enough space to simply overwrite the whole block */
0cdb319c9ee8e6 David Howells 2021-10-21  466  
0cdb319c9ee8e6 David Howells 2021-10-21  467  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  468  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  469  		pos = vfs_llseek(file, *_start, SEEK_HOLE);
0cdb319c9ee8e6 David Howells 2021-10-21  470  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  471  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  472  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  473  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  474  	}
0cdb319c9ee8e6 David Howells 2021-10-21  475  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  476  		return 0; /* Fully allocated */
0cdb319c9ee8e6 David Howells 2021-10-21  477  
0cdb319c9ee8e6 David Howells 2021-10-21  478  	/* Partially allocated, but insufficient space: cull. */
0cdb319c9ee8e6 David Howells 2021-10-21  479  	pos = cachefiles_inject_remove_error();
0cdb319c9ee8e6 David Howells 2021-10-21  480  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  481  		ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
0cdb319c9ee8e6 David Howells 2021-10-21  482  				    *_start, *_len);

"ret" not set on else path.

0cdb319c9ee8e6 David Howells 2021-10-21 @483  	if (ret < 0) {
0cdb319c9ee8e6 David Howells 2021-10-21  484  		trace_cachefiles_io_error(object, file_inode(file), ret,
0cdb319c9ee8e6 David Howells 2021-10-21  485  					  cachefiles_trace_fallocate_error);
0cdb319c9ee8e6 David Howells 2021-10-21  486  		cachefiles_io_error_obj(object,
0cdb319c9ee8e6 David Howells 2021-10-21  487  					"CacheFiles: fallocate failed (%d)\n", ret);
0cdb319c9ee8e6 David Howells 2021-10-21  488  		ret = -EIO;
0cdb319c9ee8e6 David Howells 2021-10-21  489  	}
0cdb319c9ee8e6 David Howells 2021-10-21  490  
0cdb319c9ee8e6 David Howells 2021-10-21  491  	return ret;
0cdb319c9ee8e6 David Howells 2021-10-21  492  
0cdb319c9ee8e6 David Howells 2021-10-21  493  check_space:
0cdb319c9ee8e6 David Howells 2021-10-21  494  	return cachefiles_has_space(cache, 0, *_len / PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  495  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.
@ 2021-11-10  7:38 ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2021-11-10  7:38 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6585 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-rewrite-indexing-2
head:   90bb44e5d6dcd202b7443fbe2dd1f71cd408b942
commit: 0cdb319c9ee8e62be3f3c395eabfd746515a8c9b [50/64] cachefiles: Implement the I/O routines
config: powerpc-randconfig-m031-20211101 (attached as .config)
compiler: powerpc-linux-gcc (GCC) 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/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.

vim +/ret +483 fs/cachefiles/io.c

0cdb319c9ee8e6 David Howells 2021-10-21  424  static int __cachefiles_prepare_write(struct netfs_cache_resources *cres,
0cdb319c9ee8e6 David Howells 2021-10-21  425  				      loff_t *_start, size_t *_len, loff_t i_size,
0cdb319c9ee8e6 David Howells 2021-10-21  426  				      bool no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  427  {
0cdb319c9ee8e6 David Howells 2021-10-21  428  	struct cachefiles_object *object = cachefiles_cres_object(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  429  	struct cachefiles_cache *cache = object->volume->cache;
0cdb319c9ee8e6 David Howells 2021-10-21  430  	struct file *file = cachefiles_cres_file(cres);
0cdb319c9ee8e6 David Howells 2021-10-21  431  	loff_t start = *_start, pos;
0cdb319c9ee8e6 David Howells 2021-10-21  432  	size_t len = *_len, down;
0cdb319c9ee8e6 David Howells 2021-10-21  433  	int ret;
                                                ^^^^^^^^

0cdb319c9ee8e6 David Howells 2021-10-21  434  
0cdb319c9ee8e6 David Howells 2021-10-21  435  	/* Round to DIO size */
0cdb319c9ee8e6 David Howells 2021-10-21  436  	down = start - round_down(start, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  437  	*_start = start - down;
0cdb319c9ee8e6 David Howells 2021-10-21  438  	*_len = round_up(down + len, PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  439  
0cdb319c9ee8e6 David Howells 2021-10-21  440  	/* We need to work out whether there's sufficient disk space to perform
0cdb319c9ee8e6 David Howells 2021-10-21  441  	 * the write - but we can skip that check if we have space already
0cdb319c9ee8e6 David Howells 2021-10-21  442  	 * allocated.
0cdb319c9ee8e6 David Howells 2021-10-21  443  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  444  	if (no_space_allocated_yet)
0cdb319c9ee8e6 David Howells 2021-10-21  445  		goto check_space;
0cdb319c9ee8e6 David Howells 2021-10-21  446  
0cdb319c9ee8e6 David Howells 2021-10-21  447  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  448  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  449  		pos = vfs_llseek(file, *_start, SEEK_DATA);
0cdb319c9ee8e6 David Howells 2021-10-21  450  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  451  		if (pos == -ENXIO)
0cdb319c9ee8e6 David Howells 2021-10-21  452  			goto check_space; /* Unallocated tail */
0cdb319c9ee8e6 David Howells 2021-10-21  453  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  454  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  455  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  456  	}
0cdb319c9ee8e6 David Howells 2021-10-21  457  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  458  		goto check_space; /* Unallocated region */
0cdb319c9ee8e6 David Howells 2021-10-21  459  
0cdb319c9ee8e6 David Howells 2021-10-21  460  	/* We have a block that's at least partially filled - if we're low on
0cdb319c9ee8e6 David Howells 2021-10-21  461  	 * space, we need to see if it's fully allocated.  If it's not, we may
0cdb319c9ee8e6 David Howells 2021-10-21  462  	 * want to cull it.
0cdb319c9ee8e6 David Howells 2021-10-21  463  	 */
0cdb319c9ee8e6 David Howells 2021-10-21  464  	if (cachefiles_has_space(cache, 0, *_len / PAGE_SIZE) == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  465  		return 0; /* Enough space to simply overwrite the whole block */
0cdb319c9ee8e6 David Howells 2021-10-21  466  
0cdb319c9ee8e6 David Howells 2021-10-21  467  	pos = cachefiles_inject_read_error();
0cdb319c9ee8e6 David Howells 2021-10-21  468  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  469  		pos = vfs_llseek(file, *_start, SEEK_HOLE);
0cdb319c9ee8e6 David Howells 2021-10-21  470  	if (pos < 0 && pos >= (loff_t)-MAX_ERRNO) {
0cdb319c9ee8e6 David Howells 2021-10-21  471  		trace_cachefiles_io_error(object, file_inode(file), pos,
0cdb319c9ee8e6 David Howells 2021-10-21  472  					  cachefiles_trace_seek_error);
0cdb319c9ee8e6 David Howells 2021-10-21  473  		return pos;
0cdb319c9ee8e6 David Howells 2021-10-21  474  	}
0cdb319c9ee8e6 David Howells 2021-10-21  475  	if ((u64)pos >= (u64)*_start + *_len)
0cdb319c9ee8e6 David Howells 2021-10-21  476  		return 0; /* Fully allocated */
0cdb319c9ee8e6 David Howells 2021-10-21  477  
0cdb319c9ee8e6 David Howells 2021-10-21  478  	/* Partially allocated, but insufficient space: cull. */
0cdb319c9ee8e6 David Howells 2021-10-21  479  	pos = cachefiles_inject_remove_error();
0cdb319c9ee8e6 David Howells 2021-10-21  480  	if (pos == 0)
0cdb319c9ee8e6 David Howells 2021-10-21  481  		ret = vfs_fallocate(file, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
0cdb319c9ee8e6 David Howells 2021-10-21  482  				    *_start, *_len);

"ret" not set on else path.

0cdb319c9ee8e6 David Howells 2021-10-21 @483  	if (ret < 0) {
0cdb319c9ee8e6 David Howells 2021-10-21  484  		trace_cachefiles_io_error(object, file_inode(file), ret,
0cdb319c9ee8e6 David Howells 2021-10-21  485  					  cachefiles_trace_fallocate_error);
0cdb319c9ee8e6 David Howells 2021-10-21  486  		cachefiles_io_error_obj(object,
0cdb319c9ee8e6 David Howells 2021-10-21  487  					"CacheFiles: fallocate failed (%d)\n", ret);
0cdb319c9ee8e6 David Howells 2021-10-21  488  		ret = -EIO;
0cdb319c9ee8e6 David Howells 2021-10-21  489  	}
0cdb319c9ee8e6 David Howells 2021-10-21  490  
0cdb319c9ee8e6 David Howells 2021-10-21  491  	return ret;
0cdb319c9ee8e6 David Howells 2021-10-21  492  
0cdb319c9ee8e6 David Howells 2021-10-21  493  check_space:
0cdb319c9ee8e6 David Howells 2021-10-21  494  	return cachefiles_has_space(cache, 0, *_len / PAGE_SIZE);
0cdb319c9ee8e6 David Howells 2021-10-21  495  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.
  2021-11-10  7:38 ` Dan Carpenter
@ 2021-11-10 14:31   ` David Howells
  -1 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2021-11-10 14:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: dhowells, kbuild, lkp, kbuild-all, linux-kernel

That branch is obsolete as Linus was unhappy with the way it does things, but
I'm keeping it around for the moment for diffing purposes.

David


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret'.
@ 2021-11-10 14:31   ` David Howells
  0 siblings, 0 replies; 5+ messages in thread
From: David Howells @ 2021-11-10 14:31 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 148 bytes --]

That branch is obsolete as Linus was unhappy with the way it does things, but
I'm keeping it around for the moment for diffing purposes.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-10 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 21:12 [dhowells-fs:fscache-rewrite-indexing-2 50/64] fs/cachefiles/io.c:483 __cachefiles_prepare_write() error: uninitialized symbol 'ret' kernel test robot
2021-11-10  7:38 ` Dan Carpenter
2021-11-10  7:38 ` Dan Carpenter
2021-11-10 14:31 ` David Howells
2021-11-10 14:31   ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.