[PATCH] afs: Fix afs_write_end() when called with copied == 0 [ver #2]

kernel test robot lkp at intel.com
Sat Nov 14 14:12:27 EST 2020


Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master v5.10-rc3 next-20201113]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/David-Howells/afs-Fix-afs_write_end-when-called-with-copied-0-ver-2/20201115-012626
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git f01c30de86f1047e9bae1b1b1417b0ce8dcd15b1
config: microblaze-randconfig-r022-20201115 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/3486f1e413fba9587ced6c768d75e993ef78ce9d
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Howells/afs-Fix-afs_write_end-when-called-with-copied-0-ver-2/20201115-012626
        git checkout 3486f1e413fba9587ced6c768d75e993ef78ce9d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All errors (new ones prefixed by >>):

   fs/afs/write.c: In function 'afs_write_end':
>> fs/afs/write.c:202:3: error: implicit declaration of function 'SetPageUptoodate'; did you mean 'SetPageUptodate'? [-Werror=implicit-function-declaration]
     202 |   SetPageUptoodate(page);
         |   ^~~~~~~~~~~~~~~~
         |   SetPageUptodate
   cc1: some warnings being treated as errors

vim +202 fs/afs/write.c

   158	
   159	/*
   160	 * finalise part of a write to a page
   161	 */
   162	int afs_write_end(struct file *file, struct address_space *mapping,
   163			  loff_t pos, unsigned len, unsigned copied,
   164			  struct page *page, void *fsdata)
   165	{
   166		struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
   167		struct key *key = afs_file_key(file);
   168		unsigned long priv;
   169		unsigned int f, from = pos & (PAGE_SIZE - 1);
   170		unsigned int t, to = from + copied;
   171		loff_t i_size, maybe_i_size;
   172		int ret = 0;
   173	
   174		_enter("{%llx:%llu},{%lx}",
   175		       vnode->fid.vid, vnode->fid.vnode, page->index);
   176	
   177		if (copied == 0)
   178			goto out;
   179	
   180		maybe_i_size = pos + copied;
   181	
   182		i_size = i_size_read(&vnode->vfs_inode);
   183		if (maybe_i_size > i_size) {
   184			write_seqlock(&vnode->cb_lock);
   185			i_size = i_size_read(&vnode->vfs_inode);
   186			if (maybe_i_size > i_size)
   187				i_size_write(&vnode->vfs_inode, maybe_i_size);
   188			write_sequnlock(&vnode->cb_lock);
   189		}
   190	
   191		if (!PageUptodate(page)) {
   192			if (copied < len) {
   193				/* Try and load any missing data from the server.  The
   194				 * unmarshalling routine will take care of clearing any
   195				 * bits that are beyond the EOF.
   196				 */
   197				ret = afs_fill_page(vnode, key, pos + copied,
   198						    len - copied, page);
   199				if (ret < 0)
   200					goto out;
   201			}
 > 202			SetPageUptoodate(page);
   203		}
   204	
   205		if (PagePrivate(page)) {
   206			priv = page_private(page);
   207			f = afs_page_dirty_from(priv);
   208			t = afs_page_dirty_to(priv);
   209			if (from < f)
   210				f = from;
   211			if (to > t)
   212				t = to;
   213			priv = afs_page_dirty(f, t);
   214			set_page_private(page, priv);
   215			trace_afs_page_dirty(vnode, tracepoint_string("dirty+"),
   216					     page->index, priv);
   217		} else {
   218			priv = afs_page_dirty(from, to);
   219			attach_page_private(page, (void *)priv);
   220			trace_afs_page_dirty(vnode, tracepoint_string("dirty"),
   221					     page->index, priv);
   222		}
   223	
   224		set_page_dirty(page);
   225		if (PageDirty(page))
   226			_debug("dirtied");
   227		ret = copied;
   228	
   229	out:
   230		unlock_page(page);
   231		put_page(page);
   232		return ret;
   233	}
   234	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 39028 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-afs/attachments/20201115/b8679d98/attachment-0001.gz>


More information about the linux-afs mailing list