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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 98C6DC07E96 for ; Tue, 13 Jul 2021 06:00:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A46961042 for ; Tue, 13 Jul 2021 06:00:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230374AbhGMGCw (ORCPT ); Tue, 13 Jul 2021 02:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbhGMGCw (ORCPT ); Tue, 13 Jul 2021 02:02:52 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB79DC0613DD; Mon, 12 Jul 2021 23:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1D07VBYHVlfVW177ehSNjfkxJ96KWMGyfdK1Ulmhwzo=; b=M+fYzrlIfp6yhbAuJdNoK/NvWF fURYIdss5pnxUmi4WlMY0NBeq5C/CnLHT265KG/4C+pzkOkQcAYrxl2PWTiRM5c+yQdSdLN/ry8pP MXPQtAOj3Zp4fL7guTW7GJC0yN/ib4tyA9jZgvFimcRMWyNqMdTZKxWCy1tbtTqiQ6cT+vPKC/8wN pZMkc5BKdM6LdOT8E+JQpAxlP8pzOVXVhcX1sBPKpyhrzo2MBWv3ABGnXWt/EkOUnksLHlnB/oFum Zlg/JFKDztbD83RowHH/ucjHxKalCFvT8xHqRt7FFEfE+zv3POEngluWV0esGd/KuBfecS9iE8KMq v20KkQIw==; Received: from hch by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3BSC-000myC-Ou; Tue, 13 Jul 2021 05:59:44 +0000 Date: Tue, 13 Jul 2021 06:59:36 +0100 From: Christoph Hellwig To: "Elliott, Robert (Servers)" Cc: 'Matteo Croce' , "linux-block@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , Jens Axboe , "linux-kernel@vger.kernel.org" , Lennart Poettering , Luca Boccassi , Alexander Viro , Damien Le Moal , Tejun Heo , Javier Gonz?lez , Niklas Cassel , Johannes Thumshirn , Hannes Reinecke , Matthew Wilcox , Christoph Hellwig , JeffleXu Subject: Re: [PATCH v4 3/5] block: add ioctl to read the disk sequence number Message-ID: References: <20210711175415.80173-1-mcroce@linux.microsoft.com> <20210711175415.80173-4-mcroce@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On Mon, Jul 12, 2021 at 07:22:43PM +0000, Elliott, Robert (Servers) wrote: > static int put_u64(u64 __user *argp, u64 val) > { > return put_user(val, argp); > } > > > diff --git a/block/ioctl.c b/block/ioctl.c > > index 24beec9ca9c9..0c3a4a53fa11 100644 > > --- a/block/ioctl.c > > +++ b/block/ioctl.c > > @@ -469,6 +469,8 @@ static int blkdev_common_ioctl(struct block_device > > *bdev, fmode_t mode, > > BLKDEV_DISCARD_SECURE); > ... > > > + case BLKGETDISKSEQ: > > + return put_u64(argp, bdev->bd_disk->diskseq); > > How does that work on a system in which int is 32 bits? Why would it not work? put_user is a magic macro that works on all scalar value.