Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp948727ybz; Wed, 22 Apr 2020 10:46:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLpezNujz64jv1OyLktwRpWJDoDwGMnkVMUmOzSkLRAqdBdnU1rEeb+beN9/al8T/P3LLT6 X-Received: by 2002:aa7:cd01:: with SMTP id b1mr14311206edw.163.1587577564753; Wed, 22 Apr 2020 10:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587577564; cv=none; d=google.com; s=arc-20160816; b=v3xEJeuJ/w0PMXVqujHal55bUBT+cgXNr17loiUnC7e7Q7dxIF7qB1hbyAMsIjU5M6 +/UXM8RobW5WPUnByZiKPr2GGQxP4VTKUrIgEWaDXs3ISNVUzwEUxC5SQ48tK85pt1Di mktVdM2x7dkBVOWvWoMUxEm4/JPFZ44SXmnmHEl5WNYkAvwZFmkt3hSJRNZbp8WU5igi 2wGPBIm+cNZHFUB1PmUcbyn0gzgNAO52mNlPX/KsJfjdC7KCt05/B7AtJkGeGdpRTQev nPMZcFJXgMtKma0YKqzzAQ5yNejvw69L2yiWHdXwZ0wfCF9QLX/PrMof2Is8KpTZO3DQ vNKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=W888O22gK/W8dlsN6cr8Wj/SA6FzHPhMRaLb5ntHKBk=; b=N7vpRDDQ2Gn0ICUWxm76cF1Em16QKDsSM3K2lUEWfBlET5iWt11gBixHJZiwElpcZV z/22z+dVt2dFU5/MSXiYhU1K2ihWK7huq/sAqX1Jv+OrmYrd5wykEAJ06CMyaDw12vEV HJqMz5WILz9bePOsoIUeYElRHr3zZyG7PmOYDJr2GFT1Gcl3cAP7jEIDLBvrikiiFIt6 u8lrULgUNGeKtqBzHeknHpwi6y9VUmajhGjK63RfbgcM9l9VVsN6pTf83E4hXiHQI34O MqkQ53mjV2RRx5xJ3uDw61XDgIMN1Rr8VrhoCQtfNbrt58YksLznEIQaEwr3ZKihAIsx 82sA== 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 x17si3595098ejs.372.2020.04.22.10.45.41; Wed, 22 Apr 2020 10:46:04 -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 S1726876AbgDVRof (ORCPT + 99 others); Wed, 22 Apr 2020 13:44:35 -0400 Received: from verein.lst.de ([213.95.11.211]:53946 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbgDVRof (ORCPT ); Wed, 22 Apr 2020 13:44:35 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 028E568C4E; Wed, 22 Apr 2020 19:44:32 +0200 (CEST) Date: Wed, 22 Apr 2020 19:44:31 +0200 From: Christoph Hellwig To: Martijn Coenen Cc: axboe@kernel.dk, hch@lst.de, ming.lei@redhat.com, narayan@google.com, zezeozue@google.com, kernel-team@android.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, maco@google.com, bvanassche@acm.org, Chaitanya.Kulkarni@wdc.com, jaegeuk@kernel.org Subject: Re: [PATCH v2 5/5] loop: Add LOOP_SET_FD_AND_STATUS ioctl Message-ID: <20200422174431.GE30852@lst.de> References: <20200422100636.46357-1-maco@android.com> <20200422100636.46357-6-maco@android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422100636.46357-6-maco@android.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > + case LOOP_SET_FD: { > + /* legacy case - pass in a zeroed out loop_info64, which > + * corresponds with the default parameters we'd have used > + * otherwise. > + */ Nitpick: kernel coding style always has the /* on a line of its own. Also please capitalize the first word in a multi-line comment. > + struct loop_info64 info; > + > + memset(&info, 0, sizeof(info)); > + return loop_set_fd_and_status(lo, mode, bdev, arg, &info); > + } > + case LOOP_SET_FD_AND_STATUS: { > + struct loop_fd_and_status fds; > + > + if (copy_from_user(&fds, argp, sizeof(fds))) > + return -EFAULT; > + > + return loop_set_fd_and_status(lo, mode, bdev, fds.fd, > + &fds.info); What about actually passing the whole loop_fd_and_status structure? Otherwise this looks good: Reviewed-by: Christoph Hellwig