Re: [PATCH v7] fs: Add VirtualBox guest shared folder (vboxsf) support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.16 next-20180329]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/fs-Add-VirtualBox-guest-shared-folder-vboxsf-support/20180331-001843
config: x86_64-randconfig-g0-04030108 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   fs//vboxsf/file.c: In function 'sf_readpage':
>> fs//vboxsf/file.c:236:2: error: implicit declaration of function 'page_offset' [-Werror=implicit-function-declaration]
     loff_t off = page_offset(page);
     ^
>> fs//vboxsf/file.c:241:2: error: implicit declaration of function 'kmap' [-Werror=implicit-function-declaration]
     buf = kmap(page);
     ^
>> fs//vboxsf/file.c:241:6: warning: assignment makes pointer from integer without a cast
     buf = kmap(page);
         ^
>> fs//vboxsf/file.c:246:3: error: implicit declaration of function 'flush_dcache_page' [-Werror=implicit-function-declaration]
      flush_dcache_page(page);
      ^
>> fs//vboxsf/file.c:247:3: error: implicit declaration of function 'SetPageUptodate' [-Werror=implicit-function-declaration]
      SetPageUptodate(page);
      ^
>> fs//vboxsf/file.c:249:3: error: implicit declaration of function 'SetPageError' [-Werror=implicit-function-declaration]
      SetPageError(page);
      ^
>> fs//vboxsf/file.c:252:2: error: implicit declaration of function 'kunmap' [-Werror=implicit-function-declaration]
     kunmap(page);
     ^
>> fs//vboxsf/file.c:253:2: error: implicit declaration of function 'unlock_page' [-Werror=implicit-function-declaration]
     unlock_page(page);
     ^
   fs//vboxsf/file.c: In function 'sf_writepage':
   fs//vboxsf/file.c:272:6: warning: assignment makes pointer from integer without a cast
     buf = kmap(page);
         ^
>> fs//vboxsf/file.c:277:3: error: implicit declaration of function 'ClearPageError' [-Werror=implicit-function-declaration]
      ClearPageError(page);
      ^
>> fs//vboxsf/file.c:281:3: error: implicit declaration of function 'ClearPageUptodate' [-Werror=implicit-function-declaration]
      ClearPageUptodate(page);
      ^
   fs//vboxsf/file.c: In function 'sf_write_end':
   fs//vboxsf/file.c:300:6: warning: assignment makes pointer from integer without a cast
     buf = kmap(page);
         ^
>> fs//vboxsf/file.c:311:2: error: implicit declaration of function 'PageUptodate' [-Werror=implicit-function-declaration]
     if (!PageUptodate(page) && nwritten == PAGE_SIZE)
     ^
>> fs//vboxsf/file.c:320:2: error: implicit declaration of function 'put_page' [-Werror=implicit-function-declaration]
     put_page(page);
     ^
   fs//vboxsf/file.c: At top level:
>> fs//vboxsf/file.c:328:20: error: '__set_page_dirty_nobuffers' undeclared here (not in a function)
     .set_page_dirty = __set_page_dirty_nobuffers,
                       ^
   cc1: some warnings being treated as errors

vim +/page_offset +236 fs//vboxsf/file.c

   231	
   232	static int sf_readpage(struct file *file, struct page *page)
   233	{
   234		struct sf_glob_info *sf_g = GET_GLOB_INFO(file_inode(file)->i_sb);
   235		struct sf_reg_info *sf_r = file->private_data;
 > 236		loff_t off = page_offset(page);
   237		u32 nread = PAGE_SIZE;
   238		u8 *buf;
   239		int err;
   240	
 > 241		buf = kmap(page);
   242	
   243		err = vboxsf_read(sf_g->root, sf_r->handle, off, &nread, buf, false);
   244		if (err == 0) {
   245			memset(&buf[nread], 0, PAGE_SIZE - nread);
 > 246			flush_dcache_page(page);
 > 247			SetPageUptodate(page);
   248		} else {
 > 249			SetPageError(page);
   250		}
   251	
 > 252		kunmap(page);
 > 253		unlock_page(page);
   254		return err;
   255	}
   256	
   257	static int sf_writepage(struct page *page, struct writeback_control *wbc)
   258	{
   259		struct inode *inode = page->mapping->host;
   260		struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
   261		struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
   262		struct sf_reg_info *sf_r = sf_i->file->private_data;
   263		loff_t off = page_offset(page);
   264		loff_t size = i_size_read(inode);
   265		u32 nwrite = PAGE_SIZE;
   266		u8 *buf;
   267		int err;
   268	
   269		if (off + PAGE_SIZE > size)
   270			nwrite = size & ~PAGE_MASK;
   271	
 > 272		buf = kmap(page);
   273		err = vboxsf_write(sf_g->root, sf_r->handle, off, &nwrite, buf, false);
   274		kunmap(page);
   275	
   276		if (err == 0) {
 > 277			ClearPageError(page);
   278			/* mtime changed */
   279			sf_i->force_restat = 1;
   280		} else {
 > 281			ClearPageUptodate(page);
   282		}
   283	
   284		unlock_page(page);
   285		return err;
   286	}
   287	
   288	int sf_write_end(struct file *file, struct address_space *mapping, loff_t pos,
   289			 unsigned int len, unsigned int copied, struct page *page,
   290			 void *fsdata)
   291	{
   292		struct inode *inode = mapping->host;
   293		struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
   294		struct sf_reg_info *sf_r = file->private_data;
   295		unsigned int from = pos & ~PAGE_MASK;
   296		u32 nwritten = len;
   297		u8 *buf;
   298		int err;
   299	
 > 300		buf = kmap(page);
   301		err = vboxsf_write(sf_g->root, sf_r->handle, pos, &nwritten,
   302				   buf + from, false);
   303		kunmap(page);
   304	
   305		if (err)
   306			goto out;
   307	
   308		/* mtime changed */
   309		GET_INODE_INFO(inode)->force_restat = 1;
   310	
 > 311		if (!PageUptodate(page) && nwritten == PAGE_SIZE)
   312			SetPageUptodate(page);
   313	
   314		pos += nwritten;
   315		if (pos > inode->i_size)
   316			i_size_write(inode, pos);
   317	
   318	out:
   319		unlock_page(page);
 > 320		put_page(page);
   321	
   322		return err;
   323	}
   324	
   325	const struct address_space_operations vboxsf_reg_aops = {
   326		.readpage = sf_readpage,
   327		.writepage = sf_writepage,
 > 328		.set_page_dirty = __set_page_dirty_nobuffers,
   329		.write_begin = simple_write_begin,
   330		.write_end = sf_write_end,
   331	};
   332	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux