[{"id":1761407,"web_url":"http://patchwork.ozlabs.org/comment/1761407/","msgid":"<20170901003029.GX10621@dastard>","list_archive_url":null,"date":"2017-09-01T00:30:29","subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","submitter":{"id":421,"url":"http://patchwork.ozlabs.org/api/people/421/","name":"Dave Chinner","email":"david@fromorbit.com"},"content":"On Thu, Aug 31, 2017 at 01:49:18PM -0700, Darrick J. Wong wrote:\n> The FMR_OF_LAST flag is set on the last fsmap record being returned for\n> the dataset requested, contrary to what the header file says.  Fix the\n> docs to reflect the behavior of all fsmap implementations.\n> \n> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>\n> ---\n>  include/uapi/linux/fsmap.h |    2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/include/uapi/linux/fsmap.h b/include/uapi/linux/fsmap.h\n> index 7e8e5f0b..e5213c3 100644\n> --- a/include/uapi/linux/fsmap.h\n> +++ b/include/uapi/linux/fsmap.h\n> @@ -96,7 +96,7 @@ fsmap_advance(\n>  #define FMR_OF_EXTENT_MAP\t0x4\t/* segment = extent map */\n>  #define FMR_OF_SHARED\t\t0x8\t/* segment = shared with another file */\n>  #define FMR_OF_SPECIAL_OWNER\t0x10\t/* owner is a special value */\n> -#define FMR_OF_LAST\t\t0x20\t/* segment is the last in the FS */\n> +#define FMR_OF_LAST\t\t0x20\t/* segment is the last in the dataset */\n>  \n>  /* Each FS gets to define its own special owner codes. */\n>  #define FMR_OWNER(type, code)\t(((__u64)type << 32) | \\\n\nLooks fine.\n\nReviewed-by: Dave Chinner <dchinner@redhat.com>","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xk0X001t9z9s8J\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 10:30:40 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751964AbdIAAah (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 31 Aug 2017 20:30:37 -0400","from ipmail06.adl2.internode.on.net ([150.101.137.129]:26278 \"EHLO\n\tipmail06.adl2.internode.on.net\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1751404AbdIAAag (ORCPT\n\t<rfc822;linux-ext4@vger.kernel.org>);\n\tThu, 31 Aug 2017 20:30:36 -0400","from ppp59-167-129-252.static.internode.on.net (HELO dastard)\n\t([59.167.129.252]) by ipmail06.adl2.internode.on.net with ESMTP;\n\t01 Sep 2017 10:00:30 +0930","from dave by dastard with local (Exim 4.80)\n\t(envelope-from <david@fromorbit.com>)\n\tid 1dnZqv-0005y8-Um; Fri, 01 Sep 2017 10:30:29 +1000"],"X-IronPort-Anti-Spam-Filtered":"true","X-IronPort-Anti-Spam-Result":"A2D8AQCSqahZ//yBpztdGgEBAQECAQEBAQgBAQEBhVOPC49mAQEBAQEBBoEqjRiLIYVBAgIBAQKEZgECAQEBAQECayiFGQEFOhwjEAgDGAklDwUlAyETiCgDgXkMsX6LYgELASUggwqDCYVShD6GDB8FmDGIPpREkntIlX1XgQ0yIQgcFYd2LjaIGYJBAQEB","Date":"Fri, 1 Sep 2017 10:30:29 +1000","From":"Dave Chinner <david@fromorbit.com>","To":"\"Darrick J. Wong\" <darrick.wong@oracle.com>","Cc":"xfs <linux-xfs@vger.kernel.org>, linux-api@vger.kernel.org,\n\tlinux-fsdevel <linux-fsdevel@vger.kernel.org>,\n\tlinux-ext4 <linux-ext4@vger.kernel.org>","Subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","Message-ID":"<20170901003029.GX10621@dastard>","References":"<20170831204918.GA7404@magnolia>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170831204918.GA7404@magnolia>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}},{"id":1761508,"web_url":"http://patchwork.ozlabs.org/comment/1761508/","msgid":"<20170901080904.GA32746@infradead.org>","list_archive_url":null,"date":"2017-09-01T08:09:04","subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","submitter":{"id":178,"url":"http://patchwork.ozlabs.org/api/people/178/","name":"Christoph Hellwig","email":"hch@infradead.org"},"content":"On Thu, Aug 31, 2017 at 01:49:18PM -0700, Darrick J. Wong wrote:\n> The FMR_OF_LAST flag is set on the last fsmap record being returned for\n> the dataset requested, contrary to what the header file says.  Fix the\n> docs to reflect the behavior of all fsmap implementations.\n\nHmm.  What's the point of the flag then given that you can trivially\ndeduce the last entry from fmh_entries?","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=infradead.org header.i=@infradead.org\n\theader.b=\"PjlZEFs+\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkBj20fRZz9s4s\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  1 Sep 2017 18:09:10 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751437AbdIAIJH (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 04:09:07 -0400","from bombadil.infradead.org ([65.50.211.133]:40784 \"EHLO\n\tbombadil.infradead.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751367AbdIAIJE (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Fri, 1 Sep 2017 04:09:04 -0400","from hch by bombadil.infradead.org with local (Exim 4.87 #1 (Red\n\tHat Linux)) id 1dnh0i-0000I5-3x; Fri, 01 Sep 2017 08:09:04 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=bombadil.20170209;\n\th=In-Reply-To:Content-Type:MIME-Version\n\t:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:\n\tList-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=AoWVXJUEMls9xA/I8pGwagy1ka1ka4HF9AQrIGBYxV8=;\n\tb=PjlZEFs+jBXqcVlzg+blioXrp\n\tDmVMdZbgbr1QlXKvAeHblr9Q2RuNkbE778x4d3Jf6Ge70ZPIhCDzCEv9uPYKUN2aXcXFuGmbGNq8/\n\tk2w073ZR/f0F2Hl+pFXkDHsMOR5rua9tAg4CK+W8IR4oXsCBO9l0SXZ9TJRbnurrDE8tcW8ZT4yqb\n\t1qATJBzp/SBHkJ8Z+5IE9RWwNzveyapLGlIqaanmQ2LtjzqkuRFA4QM8tnee3efgbUoBoJ17sh8VU\n\tWjQ5edjBtG6y6vA0nBf503NFNfY593HykvnEe2I7KBDZrfsSCP2WImfCuvM3d47mBHyYArSE5B2FO\n\trsDGbCfhw==;","Date":"Fri, 1 Sep 2017 01:09:04 -0700","From":"Christoph Hellwig <hch@infradead.org>","To":"\"Darrick J. Wong\" <darrick.wong@oracle.com>","Cc":"xfs <linux-xfs@vger.kernel.org>, linux-api@vger.kernel.org,\n\tlinux-fsdevel <linux-fsdevel@vger.kernel.org>,\n\tlinux-ext4 <linux-ext4@vger.kernel.org>","Subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","Message-ID":"<20170901080904.GA32746@infradead.org>","References":"<20170831204918.GA7404@magnolia>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170831204918.GA7404@magnolia>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-SRS-Rewrite":"SMTP reverse-path rewritten from <hch@infradead.org> by\n\tbombadil.infradead.org. See http://www.infradead.org/rpr.html","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}},{"id":1761750,"web_url":"http://patchwork.ozlabs.org/comment/1761750/","msgid":"<20170901150716.GW3775@magnolia>","list_archive_url":null,"date":"2017-09-01T15:07:16","subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","submitter":{"id":18086,"url":"http://patchwork.ozlabs.org/api/people/18086/","name":"Darrick Wong","email":"darrick.wong@oracle.com"},"content":"On Fri, Sep 01, 2017 at 01:09:04AM -0700, Christoph Hellwig wrote:\n> On Thu, Aug 31, 2017 at 01:49:18PM -0700, Darrick J. Wong wrote:\n> > The FMR_OF_LAST flag is set on the last fsmap record being returned for\n> > the dataset requested, contrary to what the header file says.  Fix the\n> > docs to reflect the behavior of all fsmap implementations.\n> \n> Hmm.  What's the point of the flag then given that you can trivially\n> deduce the last entry from fmh_entries?\n\nfmh_entries is the number of records returned, not the number of records\nin the dataset.  If, for example, you allocate space for 100 records and\nperform a query for a block that has been reflinked 1000 times, the\ndataset size is 1000 but fmh_entries is set to 100.  The lack of a LAST\nflag on the 100th record tells you that there's more records to return.\n\nIf however you allocate space for 100 records and the block is reflinked\nexactly 100 times, there's no way (without the flag) for userspace to\nknow that record 100 is the end of the dataset, so the only thing it can\ndo is to fsmap_advance() and try the query again, only to receive zero\nresults.  Granted I don't think fsmap queries are all /that/ expensive,\nbut it's trivial for the kernel to set the flag.\n\n--D\n\n> --\n> To unsubscribe from this list: send the line \"unsubscribe linux-xfs\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xkN0764BWz9t2x\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat,  2 Sep 2017 01:07:51 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752143AbdIAPHt (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tFri, 1 Sep 2017 11:07:49 -0400","from userp1040.oracle.com ([156.151.31.81]:22312 \"EHLO\n\tuserp1040.oracle.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1750952AbdIAPHr (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Fri, 1 Sep 2017 11:07:47 -0400","from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71])\n\tby userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with\n\tESMTP id v81F7KQ7011059\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Fri, 1 Sep 2017 15:07:20 GMT","from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235])\n\tby userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tv81F7JCm008050\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Fri, 1 Sep 2017 15:07:20 GMT","from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12])\n\tby aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id\n\tv81F7JSV010785; Fri, 1 Sep 2017 15:07:19 GMT","from localhost (/73.25.142.12)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Fri, 01 Sep 2017 08:07:19 -0700"],"Date":"Fri, 1 Sep 2017 08:07:16 -0700","From":"\"Darrick J. Wong\" <darrick.wong@oracle.com>","To":"Christoph Hellwig <hch@infradead.org>","Cc":"xfs <linux-xfs@vger.kernel.org>, linux-api@vger.kernel.org,\n\tlinux-fsdevel <linux-fsdevel@vger.kernel.org>,\n\tlinux-ext4 <linux-ext4@vger.kernel.org>","Subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","Message-ID":"<20170901150716.GW3775@magnolia>","References":"<20170831204918.GA7404@magnolia>\n\t<20170901080904.GA32746@infradead.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170901080904.GA32746@infradead.org>","User-Agent":"Mutt/1.5.24 (2015-08-30)","X-Source-IP":"userv0021.oracle.com [156.151.31.71]","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}},{"id":1762228,"web_url":"http://patchwork.ozlabs.org/comment/1762228/","msgid":"<20170903084102.GC32385@infradead.org>","list_archive_url":null,"date":"2017-09-03T08:41:02","subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","submitter":{"id":178,"url":"http://patchwork.ozlabs.org/api/people/178/","name":"Christoph Hellwig","email":"hch@infradead.org"},"content":"On Fri, Sep 01, 2017 at 08:07:16AM -0700, Darrick J. Wong wrote:\n> fmh_entries is the number of records returned, not the number of records\n> in the dataset.  If, for example, you allocate space for 100 records and\n> perform a query for a block that has been reflinked 1000 times, the\n> dataset size is 1000 but fmh_entries is set to 100.  The lack of a LAST\n> flag on the 100th record tells you that there's more records to return.\n> \n> If however you allocate space for 100 records and the block is reflinked\n> exactly 100 times, there's no way (without the flag) for userspace to\n> know that record 100 is the end of the dataset, so the only thing it can\n> do is to fsmap_advance() and try the query again, only to receive zero\n> results.  Granted I don't think fsmap queries are all /that/ expensive,\n> but it's trivial for the kernel to set the flag.\n\nOh, ok - it had to look up this defintion of dataset first.  With\nthat the explanation makes total sense:\n\nReviewed-by: Christoph Hellwig <hch@lst.de>","headers":{"Return-Path":"<linux-ext4-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=linux-ext4-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=infradead.org header.i=@infradead.org\n\theader.b=\"DA8+7zVC\"; dkim-atps=neutral"],"Received":["from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xlRK51k8sz9s83\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun,  3 Sep 2017 18:41:13 +1000 (AEST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751517AbdICIlD (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tSun, 3 Sep 2017 04:41:03 -0400","from bombadil.infradead.org ([65.50.211.133]:56871 \"EHLO\n\tbombadil.infradead.org\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751119AbdICIlC (ORCPT\n\t<rfc822; linux-ext4@vger.kernel.org>); Sun, 3 Sep 2017 04:41:02 -0400","from hch by bombadil.infradead.org with local (Exim 4.87 #1 (Red\n\tHat Linux)) id 1doQSk-0002ku-5D; Sun, 03 Sep 2017 08:41:02 +0000"],"DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=bombadil.20170209;\n\th=In-Reply-To:Content-Type:MIME-Version\n\t:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:\n\tContent-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:\n\tResent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:\n\tList-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive;\n\tbh=KgCdUIr7Vbh5SsSPWcCDfCi6ZsPXgkxTcBgMcStbQJM=;\n\tb=DA8+7zVC15NHue9Ci2ftyLNiv\n\twVP2rl31QkZdUgmMKYCVuF7WHJmHjAI+eYN5T+Kf81Pk9NCC6LwvcQa6Rx9K3TQ+AvwxKZwuvTTKG\n\tuxT1WOIOQ5f3bdmO1tGkpbzNKQHGMSY0K/dk9BRi1rCxwyPso1QYKQJVXQ0gBmN/ufgOF1g3/M/mH\n\tuHu81XZFCfjqw4S/wzwPlzUcCmIiD2y0+kKf02weFIea/wZL0+aNIVFVWrIbWFCIWmsfbQ0H04UZK\n\t5+8yMFWI3C6O0WDIxeeJnxZs/C8xmbE5uK5jfRVwK9KLYt/BXsT2S20YJVvpRJwSZUbTbR8vtWtsd\n\taxJ+yWn0g==;","Date":"Sun, 3 Sep 2017 01:41:02 -0700","From":"Christoph Hellwig <hch@infradead.org>","To":"\"Darrick J. Wong\" <darrick.wong@oracle.com>","Cc":"Christoph Hellwig <hch@infradead.org>,\n\txfs <linux-xfs@vger.kernel.org>, linux-api@vger.kernel.org,\n\tlinux-fsdevel <linux-fsdevel@vger.kernel.org>,\n\tlinux-ext4 <linux-ext4@vger.kernel.org>","Subject":"Re: [PATCH] fsmap: fix documentation of FMR_OF_LAST","Message-ID":"<20170903084102.GC32385@infradead.org>","References":"<20170831204918.GA7404@magnolia>\n\t<20170901080904.GA32746@infradead.org>\n\t<20170901150716.GW3775@magnolia>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20170901150716.GW3775@magnolia>","User-Agent":"Mutt/1.8.3 (2017-05-23)","X-SRS-Rewrite":"SMTP reverse-path rewritten from <hch@infradead.org> by\n\tbombadil.infradead.org. See http://www.infradead.org/rpr.html","Sender":"linux-ext4-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<linux-ext4.vger.kernel.org>","X-Mailing-List":"linux-ext4@vger.kernel.org"}}]