Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp996262pxj; Fri, 4 Jun 2021 03:38:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCU1SjLOF4ObtEs6V3hBSRD7nmRk5WCTO65c0zYyXqf/JWmZ+odE0X/37rHDHKSqorQQMT X-Received: by 2002:a17:907:e8d:: with SMTP id ho13mr3539165ejc.387.1622803086760; Fri, 04 Jun 2021 03:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622803086; cv=none; d=google.com; s=arc-20160816; b=kU4TDVfIYw9F/ZlQFejt75ZqfBDbVuUtuECV1eB9mcTHlziu4+hx8OjspD++bt/rvk j5TQy29jQGWZ92WFcyBhnoUDTp310vCrdfIzKrNdz5h/YYko7wkkTj0Y4gnrxDvylsBd 3a0MOknt2KTKl5joVtM6qQNVY+PcGX078cSYMvsYQUumOL4nH/hLeinDFuSWnA2QXaeR x33lQy3WKDFI5lgq2qKtR83OCL1jkiemky6M7/gnnC4z3lXg2/43n6X1d1NtX5Env4zx RKsRLVC5Wig75PA2mBIFgQQvVHq8DbwVk4K5+XSyc8RCYcXQu2f/MiVLGh13RW++zjWW y4Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pQ5KKPeOXIu2/FUCBVnYOqY1ov9GUkP4+rlzyvZDopc=; b=mwiNygyVAL/OupLs87JktMx1JeYpV+Uvl2ltQVPXDknzlwsWxnA7XVyll1DzT6bxA3 l+9Kv8y3uyavM2x4CmP1bVZXFOOcIjb/Kooqo1TvzCskPwytassnJ2bJD2cmS9Ok9TD0 pyIKCp9rfNp4rg3SgrVCdcJ/0qr0GBcZybQKtSFW3wuSow7PQw7Pprq6M0bZ4mSnM5l8 qi3M4P2irlGp5Oy3dDEM+YrequrVJwzrskEw9y8Gw62DwnDUa3QtSdLm5T/vT0ac4z/N Ib6SP5qGp9RAze+3UBJ4HX33I7nXnaFK8Q3aQr9mi+v8GO0P3uey9YH9U9hm5ULM91SH tI9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si5457622edb.418.2021.06.04.03.37.42; Fri, 04 Jun 2021 03:38:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229674AbhFDKhn (ORCPT + 99 others); Fri, 4 Jun 2021 06:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229692AbhFDKhn (ORCPT ); Fri, 4 Jun 2021 06:37:43 -0400 Received: from laurent.telenet-ops.be (laurent.telenet-ops.be [IPv6:2a02:1800:110:4::f00:19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D807BC06174A for ; Fri, 4 Jun 2021 03:35:56 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:f130:bbcb:eb08:8a92]) by laurent.telenet-ops.be with bizsmtp id Cybt250012NEgeT01ybtHG; Fri, 04 Jun 2021 12:35:53 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lp7BA-00Cc2O-MU; Fri, 04 Jun 2021 12:35:52 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lp5id-001cIZ-N9; Fri, 04 Jun 2021 11:02:19 +0200 From: Geert Uytterhoeven To: Steve French , Shyam Prasad N Cc: linux-cifs@vger.kernel.org, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] cifs: Change cifs_ses.chans_need_reconnect and chan_index to "unsigned long" Date: Fri, 4 Jun 2021 11:02:19 +0200 Message-Id: <20210604090219.385504-1-geert@linux-m68k.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 32-bit (e.g. m68k): fs/cifs/cifssmb.c: In function ‘cifs_reconnect_tcon’: ./include/linux/kern_levels.h:5:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] fs/cifs/cifssmb.c:201:42: note: format string is defined here 201 | cifs_dbg(FYI, "sess reconnect mask: 0x%lx, tcon reconnect: %d", | ~~^ | | | long unsigned int | %x fs/cifs/transport.c: In function ‘cifs_pick_channel’: fs/cifs/cifsglob.h:955:20: error: passing argument 2 of ‘test_bit’ from incompatible pointer type [-Werror=incompatible-pointer-types] 955 | test_bit((index), &(ses)->chans_need_reconnect) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | size_t * {aka unsigned int *} ./arch/m68k/include/asm/bitops.h:151:66: note: expected ‘const volatile long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’} 151 | static inline int test_bit(int nr, const volatile unsigned long *vaddr) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ fs/cifs/sess.c: In function ‘cifs_chan_set_need_reconnect’: fs/cifs/sess.c:98:22: error: passing argument 2 of ‘bset_mem_set_bit’ from incompatible pointer type [-Werror=incompatible-pointer-types] 98 | set_bit(chan_index, &ses->chans_need_reconnect); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | size_t * {aka unsigned int *} ./arch/m68k/include/asm/bitops.h:41:69: note: expected ‘volatile long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’} 41 | static inline void bset_mem_set_bit(int nr, volatile unsigned long *vaddr) | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ fs/cifs/sess.c:98:22: error: passing argument 2 of ‘bfset_mem_set_bit’ from incompatible pointer type [-Werror=incompatible-pointer-types] 98 | set_bit(chan_index, &ses->chans_need_reconnect); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | | | size_t * {aka unsigned int *} ./arch/m68k/include/asm/bitops.h:50:70: note: expected ‘volatile long unsigned int *’ but argument is of type ‘size_t *’ {aka ‘unsigned int *’} 50 | static inline void bfset_mem_set_bit(int nr, volatile unsigned long *vaddr) | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ [...] As bitops can only operate on long objects, and cifs_ses_get_chan_index() already returns "unsigned long", fix this by changing cifs_ses.chans_need_reconnect and chan_index from "size_t" to "unsigned long". Fixes: 374c6c7bba3cbaa1 ("cifs: changes to support multichannel during channel reconnect") Reported-by: noreply@ellerman.id.au Signed-off-by: Geert Uytterhoeven --- Can you please add Link: headers when committing patches? I could not find this patch in the lore archives of linux-cifs or linux-fsdevel, presumably it was posted elsewhere? Thanks! --- fs/cifs/cifsglob.h | 2 +- fs/cifs/sess.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 8fea2ddd2bd7af26..a9c026af21e1e9d1 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -968,7 +968,7 @@ struct cifs_ses { * enable the sessions on top to continue to live till any * of the channels below are active. */ - size_t chans_need_reconnect; + unsigned long chans_need_reconnect; }; static inline bool diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 1721a3b246942266..1a17ddd6abbe5778 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -94,7 +94,7 @@ void cifs_chan_set_need_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) { - size_t chan_index = cifs_ses_get_chan_index(ses, server); + unsigned long chan_index = cifs_ses_get_chan_index(ses, server); set_bit(chan_index, &ses->chans_need_reconnect); cifs_dbg(FYI, "Set reconnect bitmask for chan %lu; now 0x%lx\n", chan_index, ses->chans_need_reconnect); @@ -104,7 +104,7 @@ void cifs_chan_clear_need_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) { - size_t chan_index = cifs_ses_get_chan_index(ses, server); + unsigned long chan_index = cifs_ses_get_chan_index(ses, server); clear_bit(chan_index, &ses->chans_need_reconnect); cifs_dbg(FYI, "Cleared reconnect bitmask for chan %lu; now 0x%lx\n", chan_index, ses->chans_need_reconnect); @@ -114,7 +114,7 @@ bool cifs_chan_needs_reconnect(struct cifs_ses *ses, struct TCP_Server_Info *server) { - size_t chan_index = cifs_ses_get_chan_index(ses, server); + unsigned long chan_index = cifs_ses_get_chan_index(ses, server); return CIFS_CHAN_NEEDS_RECONNECT(ses, chan_index); } -- 2.25.1