From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: [PATCH v5 10/17] fanotify: cache fsid in fsnotify_mark_connector Date: Mon, 14 Jan 2019 10:30:58 +0300 Message-ID: <20190114073058.GA4504@kadam> References: <20190110170444.30616-11-amir73il@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Matthew Bobrowski , Jan Kara , kbuild-all@01.org To: kbuild@01.org, Amir Goldstein Return-path: Content-Disposition: inline In-Reply-To: <20190110170444.30616-11-amir73il@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kbuild-bounces@lists.01.org Sender: "kbuild" List-Id: linux-fsdevel.vger.kernel.org Hi Amir, url: https://github.com/0day-ci/linux/commits/Amir-Goldstein/fanotify-add-support-for-more-event-types/20190111-090241 smatch warnings: fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'type'. fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'err'. # https://github.com/0day-ci/linux/commit/48b7a1af51abcb893917d986bc5ae5bae2d21ad6 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout 48b7a1af51abcb893917d986bc5ae5bae2d21ad6 vim +/type +194 fs/notify/fanotify/fanotify.c 1c529063 Eric Paris 2009-12-17 154 688d9244 Amir Goldstein 2019-01-10 155 static int fanotify_encode_fid(struct fanotify_event *event, 48b7a1af Amir Goldstein 2019-01-10 156 const struct path *path, gfp_t gfp, 48b7a1af Amir Goldstein 2019-01-10 157 __kernel_fsid_t *fsid) 688d9244 Amir Goldstein 2019-01-10 158 { 688d9244 Amir Goldstein 2019-01-10 159 struct fanotify_fid *fid = &event->fid; 688d9244 Amir Goldstein 2019-01-10 160 int dwords, bytes = 0; 688d9244 Amir Goldstein 2019-01-10 161 int err, type; 688d9244 Amir Goldstein 2019-01-10 162 48b7a1af Amir Goldstein 2019-01-10 163 if (!fsid) 48b7a1af Amir Goldstein 2019-01-10 164 goto out_err; 48b7a1af Amir Goldstein 2019-01-10 165 688d9244 Amir Goldstein 2019-01-10 166 fid->ext_fh = NULL; 688d9244 Amir Goldstein 2019-01-10 167 dwords = 0; 688d9244 Amir Goldstein 2019-01-10 168 err = -ENOENT; 688d9244 Amir Goldstein 2019-01-10 169 type = exportfs_encode_fh(path->dentry, NULL, &dwords, 0); 688d9244 Amir Goldstein 2019-01-10 170 if (!dwords) 688d9244 Amir Goldstein 2019-01-10 171 goto out_err; 688d9244 Amir Goldstein 2019-01-10 172 688d9244 Amir Goldstein 2019-01-10 173 bytes = dwords << 2; 688d9244 Amir Goldstein 2019-01-10 174 if (bytes > FANOTIFY_INLINE_FH_LEN) { 688d9244 Amir Goldstein 2019-01-10 175 /* Treat failure to allocate fh as failure to allocate event */ 688d9244 Amir Goldstein 2019-01-10 176 err = -ENOMEM; 688d9244 Amir Goldstein 2019-01-10 177 fid->ext_fh = kmalloc(bytes, gfp); 688d9244 Amir Goldstein 2019-01-10 178 if (!fid->ext_fh) 688d9244 Amir Goldstein 2019-01-10 179 goto out_err; 688d9244 Amir Goldstein 2019-01-10 180 } 688d9244 Amir Goldstein 2019-01-10 181 688d9244 Amir Goldstein 2019-01-10 182 type = exportfs_encode_fh(path->dentry, fanotify_fid_fh(fid, bytes), 688d9244 Amir Goldstein 2019-01-10 183 &dwords, 0); 688d9244 Amir Goldstein 2019-01-10 184 err = -EINVAL; 688d9244 Amir Goldstein 2019-01-10 185 if (!type || type == FILEID_INVALID || bytes != dwords << 2) 688d9244 Amir Goldstein 2019-01-10 186 goto out_err; 688d9244 Amir Goldstein 2019-01-10 187 48b7a1af Amir Goldstein 2019-01-10 188 fid->fsid = *fsid; 688d9244 Amir Goldstein 2019-01-10 189 event->fh_len = bytes; 688d9244 Amir Goldstein 2019-01-10 190 688d9244 Amir Goldstein 2019-01-10 191 return type; 688d9244 Amir Goldstein 2019-01-10 192 688d9244 Amir Goldstein 2019-01-10 193 out_err: 688d9244 Amir Goldstein 2019-01-10 @194 pr_warn_ratelimited("fanotify: failed to encode fid (fsid=%x.%x, type=%d, bytes=%d, err=%i)\n", 48b7a1af Amir Goldstein 2019-01-10 195 fsid ? fsid->val[0] : 0, fsid ? fsid->val[1] : 0, 688d9244 Amir Goldstein 2019-01-10 196 type, bytes, err); 688d9244 Amir Goldstein 2019-01-10 197 kfree(fid->ext_fh); 688d9244 Amir Goldstein 2019-01-10 198 fid->ext_fh = NULL; 688d9244 Amir Goldstein 2019-01-10 199 event->fh_len = 0; 688d9244 Amir Goldstein 2019-01-10 200 688d9244 Amir Goldstein 2019-01-10 201 return FILEID_INVALID; 688d9244 Amir Goldstein 2019-01-10 202 } 688d9244 Amir Goldstein 2019-01-10 203 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FAKE_REPLY_C,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E569C43612 for ; Mon, 14 Jan 2019 07:31:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CAA22086D for ; Mon, 14 Jan 2019 07:31:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="5MkNMU3C" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbfANHbZ (ORCPT ); Mon, 14 Jan 2019 02:31:25 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:59036 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbfANHbZ (ORCPT ); Mon, 14 Jan 2019 02:31:25 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0E7O4W6163657; Mon, 14 Jan 2019 07:31:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=QVMAPK5/HfoD0IzeCr7wYrdu7C6RLq7HVoU95Ykwomg=; b=5MkNMU3CL7pi6z3txyLSqV+DwqoOCZWPn0SD6CPsyNQvJednFgxe0ISPUSvSVzlhl+aJ pITYJqJkars8hN0T96j141pxnf/YdQRdGfGeZ9XOZVr8zsGZwd/DjoHQ/XPR0Yq6MyXx RLmrQIYHXWcXGERNJEQR3urCIY+zbVjF/QVI6QZydEmGl0ALeEm9EusfbcEaIkaoLpey yCouDd4Ao4z2LvegkPBAgcwniEGPdo4Mi3UfbR2HB6WksOePZCRT424YRTgjfQ1WPJEt Gm9MsSIrdll8ntI1olypcnN1wJj0hLe/zOtAFWUDG96ln6WUNTenBJqAp9bJnvRATOtf UQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2pybjruu1n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Jan 2019 07:31:17 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x0E7VAjw005390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 14 Jan 2019 07:31:11 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0E7V8tg013757; Mon, 14 Jan 2019 07:31:09 GMT Received: from kadam (/41.202.241.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 13 Jan 2019 23:31:07 -0800 Date: Mon, 14 Jan 2019 10:30:58 +0300 From: Dan Carpenter To: kbuild@01.org, Amir Goldstein Cc: kbuild-all@01.org, Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v5 10/17] fanotify: cache fsid in fsnotify_mark_connector Message-ID: <20190114073058.GA4504@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190110170444.30616-11-amir73il@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9135 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901140065 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Message-ID: <20190114073058.785ChTs09dj3tEkXU3nUVncxYGjMVbxbIxONpcXOIW4@z> Hi Amir, url: https://github.com/0day-ci/linux/commits/Amir-Goldstein/fanotify-add-support-for-more-event-types/20190111-090241 smatch warnings: fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'type'. fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error: uninitialized symbol 'err'. # https://github.com/0day-ci/linux/commit/48b7a1af51abcb893917d986bc5ae5bae2d21ad6 git remote add linux-review https://github.com/0day-ci/linux git remote update linux-review git checkout 48b7a1af51abcb893917d986bc5ae5bae2d21ad6 vim +/type +194 fs/notify/fanotify/fanotify.c 1c529063 Eric Paris 2009-12-17 154 688d9244 Amir Goldstein 2019-01-10 155 static int fanotify_encode_fid(struct fanotify_event *event, 48b7a1af Amir Goldstein 2019-01-10 156 const struct path *path, gfp_t gfp, 48b7a1af Amir Goldstein 2019-01-10 157 __kernel_fsid_t *fsid) 688d9244 Amir Goldstein 2019-01-10 158 { 688d9244 Amir Goldstein 2019-01-10 159 struct fanotify_fid *fid = &event->fid; 688d9244 Amir Goldstein 2019-01-10 160 int dwords, bytes = 0; 688d9244 Amir Goldstein 2019-01-10 161 int err, type; 688d9244 Amir Goldstein 2019-01-10 162 48b7a1af Amir Goldstein 2019-01-10 163 if (!fsid) 48b7a1af Amir Goldstein 2019-01-10 164 goto out_err; 48b7a1af Amir Goldstein 2019-01-10 165 688d9244 Amir Goldstein 2019-01-10 166 fid->ext_fh = NULL; 688d9244 Amir Goldstein 2019-01-10 167 dwords = 0; 688d9244 Amir Goldstein 2019-01-10 168 err = -ENOENT; 688d9244 Amir Goldstein 2019-01-10 169 type = exportfs_encode_fh(path->dentry, NULL, &dwords, 0); 688d9244 Amir Goldstein 2019-01-10 170 if (!dwords) 688d9244 Amir Goldstein 2019-01-10 171 goto out_err; 688d9244 Amir Goldstein 2019-01-10 172 688d9244 Amir Goldstein 2019-01-10 173 bytes = dwords << 2; 688d9244 Amir Goldstein 2019-01-10 174 if (bytes > FANOTIFY_INLINE_FH_LEN) { 688d9244 Amir Goldstein 2019-01-10 175 /* Treat failure to allocate fh as failure to allocate event */ 688d9244 Amir Goldstein 2019-01-10 176 err = -ENOMEM; 688d9244 Amir Goldstein 2019-01-10 177 fid->ext_fh = kmalloc(bytes, gfp); 688d9244 Amir Goldstein 2019-01-10 178 if (!fid->ext_fh) 688d9244 Amir Goldstein 2019-01-10 179 goto out_err; 688d9244 Amir Goldstein 2019-01-10 180 } 688d9244 Amir Goldstein 2019-01-10 181 688d9244 Amir Goldstein 2019-01-10 182 type = exportfs_encode_fh(path->dentry, fanotify_fid_fh(fid, bytes), 688d9244 Amir Goldstein 2019-01-10 183 &dwords, 0); 688d9244 Amir Goldstein 2019-01-10 184 err = -EINVAL; 688d9244 Amir Goldstein 2019-01-10 185 if (!type || type == FILEID_INVALID || bytes != dwords << 2) 688d9244 Amir Goldstein 2019-01-10 186 goto out_err; 688d9244 Amir Goldstein 2019-01-10 187 48b7a1af Amir Goldstein 2019-01-10 188 fid->fsid = *fsid; 688d9244 Amir Goldstein 2019-01-10 189 event->fh_len = bytes; 688d9244 Amir Goldstein 2019-01-10 190 688d9244 Amir Goldstein 2019-01-10 191 return type; 688d9244 Amir Goldstein 2019-01-10 192 688d9244 Amir Goldstein 2019-01-10 193 out_err: 688d9244 Amir Goldstein 2019-01-10 @194 pr_warn_ratelimited("fanotify: failed to encode fid (fsid=%x.%x, type=%d, bytes=%d, err=%i)\n", 48b7a1af Amir Goldstein 2019-01-10 195 fsid ? fsid->val[0] : 0, fsid ? fsid->val[1] : 0, 688d9244 Amir Goldstein 2019-01-10 196 type, bytes, err); 688d9244 Amir Goldstein 2019-01-10 197 kfree(fid->ext_fh); 688d9244 Amir Goldstein 2019-01-10 198 fid->ext_fh = NULL; 688d9244 Amir Goldstein 2019-01-10 199 event->fh_len = 0; 688d9244 Amir Goldstein 2019-01-10 200 688d9244 Amir Goldstein 2019-01-10 201 return FILEID_INVALID; 688d9244 Amir Goldstein 2019-01-10 202 } 688d9244 Amir Goldstein 2019-01-10 203 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation