linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nfs:testing 8/13] fs/nfs/read.c:196:5: note: in expansion of macro 'xchg'
@ 2019-08-17 22:44 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2019-08-17 22:44 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: kbuild-all, linux-nfs

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

tree:   git://git.linux-nfs.org/projects/trondmy/linux-nfs.git testing
head:   7c5d6eeac744cf8a1aec2c3655022c94e472b433
commit: 5720faf51408207e8cc36c3f879d29b6b792d4f3 [8/13] NFS: Fix spurious EIO read errors
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 5720faf51408207e8cc36c3f879d29b6b792d4f3
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/uapi/asm/intrinsics.h:22:0,
                    from arch/ia64/include/asm/intrinsics.h:11,
                    from arch/ia64/include/asm/bitops.h:19,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from fs/nfs/read.c:11:
   fs/nfs/read.c: In function 'nfs_read_completion':
   arch/ia64/include/uapi/asm/cmpxchg.h:57:2: warning: value computed is not used [-Wunused-value]
    ((__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr))))
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> fs/nfs/read.c:196:5: note: in expansion of macro 'xchg'
        xchg(&nfs_req_openctx(req)->error, error);
        ^~~~
   fs/nfs/read.c: In function 'nfs_readpage':
   arch/ia64/include/uapi/asm/cmpxchg.h:57:2: warning: value computed is not used [-Wunused-value]
    ((__typeof__(*(ptr))) __xchg((unsigned long) (x), (ptr), sizeof(*(ptr))))
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   fs/nfs/read.c:352:2: note: in expansion of macro 'xchg'
     xchg(&ctx->error, 0);
     ^~~~

vim +/xchg +196 fs/nfs/read.c

  > 11	#include <linux/time.h>
    12	#include <linux/kernel.h>
    13	#include <linux/errno.h>
    14	#include <linux/fcntl.h>
    15	#include <linux/stat.h>
    16	#include <linux/mm.h>
    17	#include <linux/slab.h>
    18	#include <linux/pagemap.h>
    19	#include <linux/sunrpc/clnt.h>
    20	#include <linux/nfs_fs.h>
    21	#include <linux/nfs_page.h>
    22	#include <linux/module.h>
    23	
    24	#include "nfs4_fs.h"
    25	#include "internal.h"
    26	#include "iostat.h"
    27	#include "fscache.h"
    28	#include "pnfs.h"
    29	#include "nfstrace.h"
    30	
    31	#define NFSDBG_FACILITY		NFSDBG_PAGECACHE
    32	
    33	static const struct nfs_pgio_completion_ops nfs_async_read_completion_ops;
    34	static const struct nfs_rw_ops nfs_rw_read_ops;
    35	
    36	static struct kmem_cache *nfs_rdata_cachep;
    37	
    38	static struct nfs_pgio_header *nfs_readhdr_alloc(void)
    39	{
    40		struct nfs_pgio_header *p = kmem_cache_zalloc(nfs_rdata_cachep, GFP_KERNEL);
    41	
    42		if (p)
    43			p->rw_mode = FMODE_READ;
    44		return p;
    45	}
    46	
    47	static void nfs_readhdr_free(struct nfs_pgio_header *rhdr)
    48	{
    49		kmem_cache_free(nfs_rdata_cachep, rhdr);
    50	}
    51	
    52	static
    53	int nfs_return_empty_page(struct page *page)
    54	{
    55		zero_user(page, 0, PAGE_SIZE);
    56		SetPageUptodate(page);
    57		unlock_page(page);
    58		return 0;
    59	}
    60	
    61	void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
    62				      struct inode *inode, bool force_mds,
    63				      const struct nfs_pgio_completion_ops *compl_ops)
    64	{
    65		struct nfs_server *server = NFS_SERVER(inode);
    66		const struct nfs_pageio_ops *pg_ops = &nfs_pgio_rw_ops;
    67	
    68	#ifdef CONFIG_NFS_V4_1
    69		if (server->pnfs_curr_ld && !force_mds)
    70			pg_ops = server->pnfs_curr_ld->pg_read_ops;
    71	#endif
    72		nfs_pageio_init(pgio, inode, pg_ops, compl_ops, &nfs_rw_read_ops,
    73				server->rsize, 0);
    74	}
    75	EXPORT_SYMBOL_GPL(nfs_pageio_init_read);
    76	
    77	void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio)
    78	{
    79		struct nfs_pgio_mirror *mirror;
    80	
    81		if (pgio->pg_ops && pgio->pg_ops->pg_cleanup)
    82			pgio->pg_ops->pg_cleanup(pgio);
    83	
    84		pgio->pg_ops = &nfs_pgio_rw_ops;
    85	
    86		/* read path should never have more than one mirror */
    87		WARN_ON_ONCE(pgio->pg_mirror_count != 1);
    88	
    89		mirror = &pgio->pg_mirrors[0];
    90		mirror->pg_bsize = NFS_SERVER(pgio->pg_inode)->rsize;
    91	}
    92	EXPORT_SYMBOL_GPL(nfs_pageio_reset_read_mds);
    93	
    94	static void nfs_readpage_release(struct nfs_page *req, int error)
    95	{
    96		struct inode *inode = d_inode(nfs_req_openctx(req)->dentry);
    97		struct page *page = req->wb_page;
    98	
    99		dprintk("NFS: read done (%s/%llu %d@%lld)\n", inode->i_sb->s_id,
   100			(unsigned long long)NFS_FILEID(inode), req->wb_bytes,
   101			(long long)req_offset(req));
   102	
   103		if (error < 0)
   104			SetPageError(page);
   105		if (nfs_page_group_sync_on_bit(req, PG_UNLOCKPAGE)) {
   106			struct address_space *mapping = page_file_mapping(page);
   107	
   108			if (PageUptodate(page))
   109				nfs_readpage_to_fscache(inode, page, 0);
   110			else if (PageError(page) && !PagePrivate(page))
   111				generic_error_remove_page(mapping, page);
   112			unlock_page(page);
   113		}
   114		nfs_release_request(req);
   115	}
   116	
   117	int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
   118			       struct page *page)
   119	{
   120		struct nfs_page	*new;
   121		unsigned int len;
   122		struct nfs_pageio_descriptor pgio;
   123		struct nfs_pgio_mirror *pgm;
   124	
   125		len = nfs_page_length(page);
   126		if (len == 0)
   127			return nfs_return_empty_page(page);
   128		new = nfs_create_request(ctx, page, 0, len);
   129		if (IS_ERR(new)) {
   130			unlock_page(page);
   131			return PTR_ERR(new);
   132		}
   133		if (len < PAGE_SIZE)
   134			zero_user_segment(page, len, PAGE_SIZE);
   135	
   136		nfs_pageio_init_read(&pgio, inode, false,
   137				     &nfs_async_read_completion_ops);
   138		if (!nfs_pageio_add_request(&pgio, new)) {
   139			nfs_list_remove_request(new);
   140			nfs_readpage_release(new, pgio.pg_error);
   141		}
   142		nfs_pageio_complete(&pgio);
   143	
   144		/* It doesn't make sense to do mirrored reads! */
   145		WARN_ON_ONCE(pgio.pg_mirror_count != 1);
   146	
   147		pgm = &pgio.pg_mirrors[0];
   148		NFS_I(inode)->read_io += pgm->pg_bytes_written;
   149	
   150		return pgio.pg_error < 0 ? pgio.pg_error : 0;
   151	}
   152	
   153	static void nfs_page_group_set_uptodate(struct nfs_page *req)
   154	{
   155		if (nfs_page_group_sync_on_bit(req, PG_UPTODATE))
   156			SetPageUptodate(req->wb_page);
   157	}
   158	
   159	static void nfs_read_completion(struct nfs_pgio_header *hdr)
   160	{
   161		unsigned long bytes = 0;
   162		int error;
   163	
   164		if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
   165			goto out;
   166		while (!list_empty(&hdr->pages)) {
   167			struct nfs_page *req = nfs_list_entry(hdr->pages.next);
   168			struct page *page = req->wb_page;
   169			unsigned long start = req->wb_pgbase;
   170			unsigned long end = req->wb_pgbase + req->wb_bytes;
   171	
   172			if (test_bit(NFS_IOHDR_EOF, &hdr->flags)) {
   173				/* note: regions of the page not covered by a
   174				 * request are zeroed in nfs_readpage_async /
   175				 * readpage_async_filler */
   176				if (bytes > hdr->good_bytes) {
   177					/* nothing in this request was good, so zero
   178					 * the full extent of the request */
   179					zero_user_segment(page, start, end);
   180	
   181				} else if (hdr->good_bytes - bytes < req->wb_bytes) {
   182					/* part of this request has good bytes, but
   183					 * not all. zero the bad bytes */
   184					start += hdr->good_bytes - bytes;
   185					WARN_ON(start < req->wb_pgbase);
   186					zero_user_segment(page, start, end);
   187				}
   188			}
   189			error = 0;
   190			bytes += req->wb_bytes;
   191			if (test_bit(NFS_IOHDR_ERROR, &hdr->flags)) {
   192				if (bytes <= hdr->good_bytes)
   193					nfs_page_group_set_uptodate(req);
   194				else {
   195					error = hdr->error;
 > 196					xchg(&nfs_req_openctx(req)->error, error);
   197				}
   198			} else
   199				nfs_page_group_set_uptodate(req);
   200			nfs_list_remove_request(req);
   201			nfs_readpage_release(req, error);
   202		}
   203	out:
   204		hdr->release(hdr);
   205	}
   206	

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-08-17 22:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-17 22:44 [nfs:testing 8/13] fs/nfs/read.c:196:5: note: in expansion of macro 'xchg' kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).