All of lore.kernel.org
 help / color / mirror / Atom feed
* [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 28/40] fs/netfs/direct_read.c:193 netfs_direct_read_iter() warn: statement has no effect 3
@ 2022-04-05  6:21 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-04-05  6:21 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "GNU/Weeb Mailing List" <gwml@vger.gnuweeb.org>
CC: linux-kernel(a)vger.kernel.org
TO: David Howells <dhowells@redhat.com>

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head:   674eea41fc70a740ff83ec590f9833f805852464
commit: 86ffcdd2a1cb7c858063208fdfb7abe941bc0b9e [28/40] netfs: Support decryption on DIO read
:::::: branch date: 14 hours ago
:::::: commit date: 15 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220405/202204051443.yYetEnPy-lkp(a)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/direct_read.c:193 netfs_direct_read_iter() warn: statement has no effect 3

vim +193 fs/netfs/direct_read.c

be1bb787e99ec1 David Howells 2022-01-14  111  
be1bb787e99ec1 David Howells 2022-01-14  112  /**
be1bb787e99ec1 David Howells 2022-01-14  113   * netfs_direct_read_iter - Perform a direct I/O read
be1bb787e99ec1 David Howells 2022-01-14  114   * @iocb: The I/O control descriptor describing the read
be1bb787e99ec1 David Howells 2022-01-14  115   * @iter: The output buffer (also specifies read length)
be1bb787e99ec1 David Howells 2022-01-14  116   */
be1bb787e99ec1 David Howells 2022-01-14  117  ssize_t netfs_direct_read_iter(struct kiocb *iocb, struct iov_iter *iter)
be1bb787e99ec1 David Howells 2022-01-14  118  {
be1bb787e99ec1 David Howells 2022-01-14  119  	struct netfs_io_request *rreq;
86ffcdd2a1cb7c David Howells 2022-02-17  120  	struct netfs_i_context *ctx;
86ffcdd2a1cb7c David Howells 2022-02-17  121  	ssize_t n, ret;
be1bb787e99ec1 David Howells 2022-01-14  122  
be1bb787e99ec1 David Howells 2022-01-14  123  	_enter("");
be1bb787e99ec1 David Howells 2022-01-14  124  
be1bb787e99ec1 David Howells 2022-01-14  125  	rreq = netfs_alloc_request(iocb->ki_filp->f_mapping, iocb->ki_filp,
be1bb787e99ec1 David Howells 2022-01-14  126  				   iocb->ki_pos, iov_iter_count(iter),
be1bb787e99ec1 David Howells 2022-01-14  127  				   NETFS_DIO_READ);
be1bb787e99ec1 David Howells 2022-01-14  128  	if (IS_ERR(rreq))
be1bb787e99ec1 David Howells 2022-01-14  129  		return PTR_ERR(rreq);
be1bb787e99ec1 David Howells 2022-01-14  130  
86ffcdd2a1cb7c David Howells 2022-02-17  131  	ctx = netfs_i_context(rreq->inode);
be1bb787e99ec1 David Howells 2022-01-14  132  	netfs_stat(&netfs_n_rh_dio_read);
be1bb787e99ec1 David Howells 2022-01-14  133  	trace_netfs_read(rreq, rreq->start, rreq->len, netfs_read_trace_dio_read);
be1bb787e99ec1 David Howells 2022-01-14  134  
86ffcdd2a1cb7c David Howells 2022-02-17  135  	rreq->buffering = NETFS_DIRECT;
86ffcdd2a1cb7c David Howells 2022-02-17  136  	if (test_bit(NETFS_RREQ_CONTENT_ENCRYPTION, &rreq->flags)) {
86ffcdd2a1cb7c David Howells 2022-02-17  137  		static const enum netfs_buffering buffering[2][2] = {
86ffcdd2a1cb7c David Howells 2022-02-17  138  			/* [async][aligned] */
86ffcdd2a1cb7c David Howells 2022-02-17  139  			[false][false]	= NETFS_BOUNCE_DEC_COPY,
86ffcdd2a1cb7c David Howells 2022-02-17  140  			[false][true]	= NETFS_BOUNCE_DEC_TO_DIRECT,
86ffcdd2a1cb7c David Howells 2022-02-17  141  			[true ][false]	= NETFS_BOUNCE_DEC_COPY_BV,
86ffcdd2a1cb7c David Howells 2022-02-17  142  			[true ][true]	= NETFS_BOUNCE_DEC_TO_DIRECT_BV,
86ffcdd2a1cb7c David Howells 2022-02-17  143  		};
86ffcdd2a1cb7c David Howells 2022-02-17  144  		bool aligned = netfs_is_crypto_aligned(rreq, iter);
86ffcdd2a1cb7c David Howells 2022-02-17  145  		bool async = !is_sync_kiocb(iocb);
86ffcdd2a1cb7c David Howells 2022-02-17  146  
86ffcdd2a1cb7c David Howells 2022-02-17  147  		rreq->buffering = buffering[async][aligned];
86ffcdd2a1cb7c David Howells 2022-02-17  148  	}
86ffcdd2a1cb7c David Howells 2022-02-17  149  
86ffcdd2a1cb7c David Howells 2022-02-17  150  	kdebug("remote_i %llx %llx %llx",
86ffcdd2a1cb7c David Howells 2022-02-17  151  	       ctx->remote_i_size, rreq->i_size, i_size_read(netfs_inode(ctx)));
be1bb787e99ec1 David Howells 2022-01-14  152  
be1bb787e99ec1 David Howells 2022-01-14  153  	/* If this is an async op, we have to keep track of the destination
be1bb787e99ec1 David Howells 2022-01-14  154  	 * buffer for ourselves as the caller's iterator will be trashed when
be1bb787e99ec1 David Howells 2022-01-14  155  	 * we return.
be1bb787e99ec1 David Howells 2022-01-14  156  	 *
be1bb787e99ec1 David Howells 2022-01-14  157  	 * In such a case, extract an iterator to represent as much of the the
be1bb787e99ec1 David Howells 2022-01-14  158  	 * output buffer as we can manage.  Note that the extraction might not
be1bb787e99ec1 David Howells 2022-01-14  159  	 * be able to allocate a sufficiently large bvec array and may shorten
be1bb787e99ec1 David Howells 2022-01-14  160  	 * the request.
be1bb787e99ec1 David Howells 2022-01-14  161  	 */
be1bb787e99ec1 David Howells 2022-01-14  162  	switch (rreq->buffering) {
be1bb787e99ec1 David Howells 2022-01-14  163  	case NETFS_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  164  	case NETFS_BOUNCE_DEC_TO_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  165  	case NETFS_BOUNCE_DEC_COPY:
be1bb787e99ec1 David Howells 2022-01-14  166  		rreq->direct_iter = *iter;
be1bb787e99ec1 David Howells 2022-01-14  167  		rreq->len = iov_iter_count(&rreq->direct_iter);
be1bb787e99ec1 David Howells 2022-01-14  168  		break;
be1bb787e99ec1 David Howells 2022-01-14  169  	case NETFS_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  170  	case NETFS_BOUNCE_DEC_TO_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  171  	case NETFS_BOUNCE_DEC_COPY_BV:
be1bb787e99ec1 David Howells 2022-01-14  172  		n = extract_iter_to_iter(iter, rreq->len, &rreq->direct_iter,
be1bb787e99ec1 David Howells 2022-01-14  173  					 &rreq->direct_bv);
be1bb787e99ec1 David Howells 2022-01-14  174  		if (n < 0) {
86ffcdd2a1cb7c David Howells 2022-02-17  175  			ret = n;
86ffcdd2a1cb7c David Howells 2022-02-17  176  			goto out;
be1bb787e99ec1 David Howells 2022-01-14  177  		}
be1bb787e99ec1 David Howells 2022-01-14  178  		rreq->direct_bv_count = n;
be1bb787e99ec1 David Howells 2022-01-14  179  		rreq->len = iov_iter_count(&rreq->direct_iter);
be1bb787e99ec1 David Howells 2022-01-14  180  		break;
be1bb787e99ec1 David Howells 2022-01-14  181  	default:
be1bb787e99ec1 David Howells 2022-01-14  182  		BUG();
be1bb787e99ec1 David Howells 2022-01-14  183  	}
be1bb787e99ec1 David Howells 2022-01-14  184  
86ffcdd2a1cb7c David Howells 2022-02-17  185  	/* If we're going to use a bounce buffer, we need to set it up.  We
86ffcdd2a1cb7c David Howells 2022-02-17  186  	 * will then need to pad the request out to the minimum block size.
86ffcdd2a1cb7c David Howells 2022-02-17  187  	 */
86ffcdd2a1cb7c David Howells 2022-02-17  188  	switch (rreq->buffering) {
86ffcdd2a1cb7c David Howells 2022-02-17  189  	case NETFS_BOUNCE_DEC_TO_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  190  	case NETFS_BOUNCE_DEC_COPY:
86ffcdd2a1cb7c David Howells 2022-02-17  191  	case NETFS_BOUNCE_DEC_TO_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  192  	case NETFS_BOUNCE_DEC_COPY_BV:
86ffcdd2a1cb7c David Howells 2022-02-17 @193  		unsigned int min_bsize = 1ULL << ctx->min_bshift;

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

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

* [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 28/40] fs/netfs/direct_read.c:193 netfs_direct_read_iter() warn: statement has no effect 3
@ 2022-04-05 10:35 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-04-05 10:35 UTC (permalink / raw)
  To: kbuild

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

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: "GNU/Weeb Mailing List" <gwml@vger.gnuweeb.org>
CC: linux-kernel(a)vger.kernel.org
TO: David Howells <dhowells@redhat.com>

tree:   https://github.com/ammarfaizi2/linux-block dhowells/linux-fs/netfs-maple
head:   674eea41fc70a740ff83ec590f9833f805852464
commit: 86ffcdd2a1cb7c858063208fdfb7abe941bc0b9e [28/40] netfs: Support decryption on DIO read
:::::: branch date: 18 hours ago
:::::: commit date: 19 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220405/202204051815.GB2C37Hk-lkp(a)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/direct_read.c:193 netfs_direct_read_iter() warn: statement has no effect 3

vim +193 fs/netfs/direct_read.c

be1bb787e99ec1 David Howells 2022-01-14  111  
be1bb787e99ec1 David Howells 2022-01-14  112  /**
be1bb787e99ec1 David Howells 2022-01-14  113   * netfs_direct_read_iter - Perform a direct I/O read
be1bb787e99ec1 David Howells 2022-01-14  114   * @iocb: The I/O control descriptor describing the read
be1bb787e99ec1 David Howells 2022-01-14  115   * @iter: The output buffer (also specifies read length)
be1bb787e99ec1 David Howells 2022-01-14  116   */
be1bb787e99ec1 David Howells 2022-01-14  117  ssize_t netfs_direct_read_iter(struct kiocb *iocb, struct iov_iter *iter)
be1bb787e99ec1 David Howells 2022-01-14  118  {
be1bb787e99ec1 David Howells 2022-01-14  119  	struct netfs_io_request *rreq;
86ffcdd2a1cb7c David Howells 2022-02-17  120  	struct netfs_i_context *ctx;
86ffcdd2a1cb7c David Howells 2022-02-17  121  	ssize_t n, ret;
be1bb787e99ec1 David Howells 2022-01-14  122  
be1bb787e99ec1 David Howells 2022-01-14  123  	_enter("");
be1bb787e99ec1 David Howells 2022-01-14  124  
be1bb787e99ec1 David Howells 2022-01-14  125  	rreq = netfs_alloc_request(iocb->ki_filp->f_mapping, iocb->ki_filp,
be1bb787e99ec1 David Howells 2022-01-14  126  				   iocb->ki_pos, iov_iter_count(iter),
be1bb787e99ec1 David Howells 2022-01-14  127  				   NETFS_DIO_READ);
be1bb787e99ec1 David Howells 2022-01-14  128  	if (IS_ERR(rreq))
be1bb787e99ec1 David Howells 2022-01-14  129  		return PTR_ERR(rreq);
be1bb787e99ec1 David Howells 2022-01-14  130  
86ffcdd2a1cb7c David Howells 2022-02-17  131  	ctx = netfs_i_context(rreq->inode);
be1bb787e99ec1 David Howells 2022-01-14  132  	netfs_stat(&netfs_n_rh_dio_read);
be1bb787e99ec1 David Howells 2022-01-14  133  	trace_netfs_read(rreq, rreq->start, rreq->len, netfs_read_trace_dio_read);
be1bb787e99ec1 David Howells 2022-01-14  134  
86ffcdd2a1cb7c David Howells 2022-02-17  135  	rreq->buffering = NETFS_DIRECT;
86ffcdd2a1cb7c David Howells 2022-02-17  136  	if (test_bit(NETFS_RREQ_CONTENT_ENCRYPTION, &rreq->flags)) {
86ffcdd2a1cb7c David Howells 2022-02-17  137  		static const enum netfs_buffering buffering[2][2] = {
86ffcdd2a1cb7c David Howells 2022-02-17  138  			/* [async][aligned] */
86ffcdd2a1cb7c David Howells 2022-02-17  139  			[false][false]	= NETFS_BOUNCE_DEC_COPY,
86ffcdd2a1cb7c David Howells 2022-02-17  140  			[false][true]	= NETFS_BOUNCE_DEC_TO_DIRECT,
86ffcdd2a1cb7c David Howells 2022-02-17  141  			[true ][false]	= NETFS_BOUNCE_DEC_COPY_BV,
86ffcdd2a1cb7c David Howells 2022-02-17  142  			[true ][true]	= NETFS_BOUNCE_DEC_TO_DIRECT_BV,
86ffcdd2a1cb7c David Howells 2022-02-17  143  		};
86ffcdd2a1cb7c David Howells 2022-02-17  144  		bool aligned = netfs_is_crypto_aligned(rreq, iter);
86ffcdd2a1cb7c David Howells 2022-02-17  145  		bool async = !is_sync_kiocb(iocb);
86ffcdd2a1cb7c David Howells 2022-02-17  146  
86ffcdd2a1cb7c David Howells 2022-02-17  147  		rreq->buffering = buffering[async][aligned];
86ffcdd2a1cb7c David Howells 2022-02-17  148  	}
86ffcdd2a1cb7c David Howells 2022-02-17  149  
86ffcdd2a1cb7c David Howells 2022-02-17  150  	kdebug("remote_i %llx %llx %llx",
86ffcdd2a1cb7c David Howells 2022-02-17  151  	       ctx->remote_i_size, rreq->i_size, i_size_read(netfs_inode(ctx)));
be1bb787e99ec1 David Howells 2022-01-14  152  
be1bb787e99ec1 David Howells 2022-01-14  153  	/* If this is an async op, we have to keep track of the destination
be1bb787e99ec1 David Howells 2022-01-14  154  	 * buffer for ourselves as the caller's iterator will be trashed when
be1bb787e99ec1 David Howells 2022-01-14  155  	 * we return.
be1bb787e99ec1 David Howells 2022-01-14  156  	 *
be1bb787e99ec1 David Howells 2022-01-14  157  	 * In such a case, extract an iterator to represent as much of the the
be1bb787e99ec1 David Howells 2022-01-14  158  	 * output buffer as we can manage.  Note that the extraction might not
be1bb787e99ec1 David Howells 2022-01-14  159  	 * be able to allocate a sufficiently large bvec array and may shorten
be1bb787e99ec1 David Howells 2022-01-14  160  	 * the request.
be1bb787e99ec1 David Howells 2022-01-14  161  	 */
be1bb787e99ec1 David Howells 2022-01-14  162  	switch (rreq->buffering) {
be1bb787e99ec1 David Howells 2022-01-14  163  	case NETFS_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  164  	case NETFS_BOUNCE_DEC_TO_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  165  	case NETFS_BOUNCE_DEC_COPY:
be1bb787e99ec1 David Howells 2022-01-14  166  		rreq->direct_iter = *iter;
be1bb787e99ec1 David Howells 2022-01-14  167  		rreq->len = iov_iter_count(&rreq->direct_iter);
be1bb787e99ec1 David Howells 2022-01-14  168  		break;
be1bb787e99ec1 David Howells 2022-01-14  169  	case NETFS_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  170  	case NETFS_BOUNCE_DEC_TO_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  171  	case NETFS_BOUNCE_DEC_COPY_BV:
be1bb787e99ec1 David Howells 2022-01-14  172  		n = extract_iter_to_iter(iter, rreq->len, &rreq->direct_iter,
be1bb787e99ec1 David Howells 2022-01-14  173  					 &rreq->direct_bv);
be1bb787e99ec1 David Howells 2022-01-14  174  		if (n < 0) {
86ffcdd2a1cb7c David Howells 2022-02-17  175  			ret = n;
86ffcdd2a1cb7c David Howells 2022-02-17  176  			goto out;
be1bb787e99ec1 David Howells 2022-01-14  177  		}
be1bb787e99ec1 David Howells 2022-01-14  178  		rreq->direct_bv_count = n;
be1bb787e99ec1 David Howells 2022-01-14  179  		rreq->len = iov_iter_count(&rreq->direct_iter);
be1bb787e99ec1 David Howells 2022-01-14  180  		break;
be1bb787e99ec1 David Howells 2022-01-14  181  	default:
be1bb787e99ec1 David Howells 2022-01-14  182  		BUG();
be1bb787e99ec1 David Howells 2022-01-14  183  	}
be1bb787e99ec1 David Howells 2022-01-14  184  
86ffcdd2a1cb7c David Howells 2022-02-17  185  	/* If we're going to use a bounce buffer, we need to set it up.  We
86ffcdd2a1cb7c David Howells 2022-02-17  186  	 * will then need to pad the request out to the minimum block size.
86ffcdd2a1cb7c David Howells 2022-02-17  187  	 */
86ffcdd2a1cb7c David Howells 2022-02-17  188  	switch (rreq->buffering) {
86ffcdd2a1cb7c David Howells 2022-02-17  189  	case NETFS_BOUNCE_DEC_TO_DIRECT:
86ffcdd2a1cb7c David Howells 2022-02-17  190  	case NETFS_BOUNCE_DEC_COPY:
86ffcdd2a1cb7c David Howells 2022-02-17  191  	case NETFS_BOUNCE_DEC_TO_DIRECT_BV:
86ffcdd2a1cb7c David Howells 2022-02-17  192  	case NETFS_BOUNCE_DEC_COPY_BV:
86ffcdd2a1cb7c David Howells 2022-02-17 @193  		unsigned int min_bsize = 1ULL << ctx->min_bshift;

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

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

end of thread, other threads:[~2022-04-05 10:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05  6:21 [ammarfaizi2-block:dhowells/linux-fs/netfs-maple 28/40] fs/netfs/direct_read.c:193 netfs_direct_read_iter() warn: statement has no effect 3 kernel test robot
2022-04-05 10:35 kernel test robot

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.