Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3673780imm; Mon, 30 Jul 2018 01:07:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeKAd7QGr4Fd6c+4LGz5WoFmsk2KWZENCr4VT8Y9s/oCuIn/iqn2rwpfz15GHJMds3rpOQU X-Received: by 2002:a65:5304:: with SMTP id m4-v6mr15263066pgq.250.1532938068778; Mon, 30 Jul 2018 01:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532938068; cv=none; d=google.com; s=arc-20160816; b=xPcWa8fv+zfLD9qtrzSuJT+F7UzYwx6msKDuz9qkSP4CekJ5ikIPSw3OwXYgLCAGhu O1UBp9MubOIsOk9Bty/W3ZnHDI/h7jmyCanN5Ss+QhnyddSqGgh2AKLcZYdCNX0HBY+g hnWRVmZlBgh2KJUmcJnw12FGrV3ygSt7/GmpLUL1V/PixfZh+tJE+IQJRe9ncyh/9ycp k2AqkqtWqjdfaXP3Bcy/MK/SmMkmdhE3I6gxUAVqji414lQUFQ3lsLUZvnrsS3jD/U7N E/Ex0BcQ7fSJT2OVIh0Z2fZxYLSv3WHNmb87+5mKETBjEnwlxpa53dczs4mnr1/MWd63 eWPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=e94hefjJJ9nOLZlYfvfBTWnXoO9EiARwl9F7vw4t8x8=; b=mRW/u7m+2p9LC8xqstaikmpEI/UquyfGuBY2HIbEEyybKmCiPjNlNr4EAE/QbLTMi3 Jx2UO7m4TWI10YFaJWbN1Glz/edvKN+MXO7duO2z9UaLEh+Ry0zanUekdLmLaC4J01E1 EiLyWRgiSYXnLhaneZO/qUlBCAZSlCW7qQc7pmG9lH4J5fRRl7iQLerk2+mDm59/wL4C g5qBbiQDerqnvEnLV9xoQdn2rpgClLPemtPG5JI52LeNM1gNePG+LNqPRQAbEyS5X8Hw qA16PNVDFiM1cZpmnHz68wtTBrlqnfULvLN3ImboVPZVeKYCkZdQ6gZIcMdmcyAnfbm7 99BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si11073409pfd.182.2018.07.30.01.07.34; Mon, 30 Jul 2018 01:07:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbeG3Jkd (ORCPT + 99 others); Mon, 30 Jul 2018 05:40:33 -0400 Received: from mx2.suse.de ([195.135.220.15]:37450 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726344AbeG3Jkc (ORCPT ); Mon, 30 Jul 2018 05:40:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 91D5CADD8; Mon, 30 Jul 2018 08:06:43 +0000 (UTC) Subject: Re: [PATCH 09/16] btrfs: IS_ERR(p) && PTR_ERR(p) == n is a weird way to spell p == ERR_PTR(n) To: Al Viro , linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Miklos Szeredi , Chris Mason , David Sterba , linux-btrfs References: <20180729220317.GB30522@ZenIV.linux.org.uk> <20180729220453.13431-1-viro@ZenIV.linux.org.uk> <20180729220453.13431-9-viro@ZenIV.linux.org.uk> From: Nikolay Borisov Openpgp: preference=signencrypt Autocrypt: addr=nborisov@suse.com; prefer-encrypt=mutual; keydata= xsFNBFiKBz4BEADNHZmqwhuN6EAzXj9SpPpH/nSSP8YgfwoOqwrP+JR4pIqRK0AWWeWCSwmZ T7g+RbfPFlmQp+EwFWOtABXlKC54zgSf+uulGwx5JAUFVUIRBmnHOYi/lUiE0yhpnb1KCA7f u/W+DkwGerXqhhe9TvQoGwgCKNfzFPZoM+gZrm+kWv03QLUCr210n4cwaCPJ0Nr9Z3c582xc bCUVbsjt7BN0CFa2BByulrx5xD9sDAYIqfLCcZetAqsTRGxM7LD0kh5WlKzOeAXj5r8DOrU2 GdZS33uKZI/kZJZVytSmZpswDsKhnGzRN1BANGP8sC+WD4eRXajOmNh2HL4P+meO1TlM3GLl EQd2shHFY0qjEo7wxKZI1RyZZ5AgJnSmehrPCyuIyVY210CbMaIKHUIsTqRgY5GaNME24w7h TyyVCy2qAM8fLJ4Vw5bycM/u5xfWm7gyTb9V1TkZ3o1MTrEsrcqFiRrBY94Rs0oQkZvunqia c+NprYSaOG1Cta14o94eMH271Kka/reEwSZkC7T+o9hZ4zi2CcLcY0DXj0qdId7vUKSJjEep c++s8ncFekh1MPhkOgNj8pk17OAESanmDwksmzh1j12lgA5lTFPrJeRNu6/isC2zyZhTwMWs k3LkcTa8ZXxh0RfWAqgx/ogKPk4ZxOXQEZetkEyTFghbRH2BIwARAQABzSJOaWtvbGF5IEJv cmlzb3YgPG5ib3Jpc292QHN1c2UuZGU+wsF4BBMBAgAiBQJYijkSAhsDBgsJCAcDAgYVCAIJ CgsEFgIDAQIeAQIXgAAKCRBxvoJG5T8oV/B6D/9a8EcRPdHg8uLEPywuJR8URwXzkofT5bZE IfGF0Z+Lt2ADe+nLOXrwKsamhweUFAvwEUxxnndovRLPOpWerTOAl47lxad08080jXnGfYFS Dc+ew7C3SFI4tFFHln8Y22Q9075saZ2yQS1ywJy+TFPADIprAZXnPbbbN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xgtQ4k92Eja9u80JDaKnHDdjdwq FUikZirB28UiLPQV6PvCckgIiukmz/5ctAfKpyYRGfez+JbAGl6iCvHYt/wAZ7Oqe/3Cirs5 KhaXBcMmJR1qo8QH8eYZ+qhFE3bSPH446+5oEw8A9v5oonKV7zMAEQEAAcLBXwQYAQIACQUC WIoHPgIbDAAKCRBxvoJG5T8oV1pyD/4zdXdOL0lhkSIjJWGqz7Idvo0wjVHSSQCbOwZDWNTN JBTP0BUxHpPu/Z8gRNNP9/k6i63T4eL1xjy4umTwJaej1X15H8Hsh+zakADyWHadbjcUXCkg OJK4NsfqhMuaIYIHbToi9K5pAKnV953xTrK6oYVyd/Rmkmb+wgsbYQJ0Ur1Ficwhp6qU1CaJ mJwFjaWaVgUERoxcejL4ruds66LM9Z1Qqgoer62ZneID6ovmzpCWbi2sfbz98+kW46aA/w8r 7sulgs1KXWhBSv5aWqKU8C4twKjlV2XsztUUsyrjHFj91j31pnHRklBgXHTD/pSRsN0UvM26 lPs0g3ryVlG5wiZ9+JbI3sKMfbdfdOeLxtL25ujs443rw1s/PVghphoeadVAKMPINeRCgoJH zZV/2Z/myWPRWWl/79amy/9MfxffZqO9rfugRBORY0ywPHLDdo9Kmzoxoxp9w3uTrTLZaT9M KIuxEcV8wcVjr+Wr9zRl06waOCkgrQbTPp631hToxo+4rA1jiQF2M80HAet65ytBVR2pFGZF zGYYLqiG+mpUZ+FPjxk9kpkRYz61mTLSY7tuFljExfJWMGfgSg1OxfLV631jV1TcdUnx+h3l Sqs2vMhAVt14zT8mpIuu2VNxcontxgVr1kzYA/tQg32fVRbGr449j1gw57BV9i0vww== Message-ID: Date: Mon, 30 Jul 2018 11:06:42 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180729220453.13431-9-viro@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ADDED David Sterba and Linux-btrfs mailing list] On 30.07.2018 01:04, Al Viro wrote: > From: Al Viro > > Cc: Chris Mason > Signed-off-by: Al Viro Reviewed-by: Nikolay Borisov David, yout might want to pull this immediately, it's a nice cleanup. > --- > fs/btrfs/transaction.c | 2 +- > fs/btrfs/tree-log.c | 5 ++--- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c > index ff5f6c719976..feb0348dbcbf 100644 > --- a/fs/btrfs/transaction.c > +++ b/fs/btrfs/transaction.c > @@ -680,7 +680,7 @@ btrfs_attach_transaction_barrier(struct btrfs_root *root) > > trans = start_transaction(root, 0, TRANS_ATTACH, > BTRFS_RESERVE_NO_FLUSH, true); > - if (IS_ERR(trans) && PTR_ERR(trans) == -ENOENT) > + if (trans == ERR_PTR(-ENOENT)) > btrfs_wait_for_commit(root->fs_info, 0); > > return trans; > diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c > index fcfbe1d8584a..2c13e8155ff1 100644 > --- a/fs/btrfs/tree-log.c > +++ b/fs/btrfs/tree-log.c > @@ -2116,7 +2116,7 @@ static noinline int check_item_in_log(struct btrfs_trans_handle *trans, > dir_key->offset, > name, name_len, 0); > } > - if (!log_di || (IS_ERR(log_di) && PTR_ERR(log_di) == -ENOENT)) { > + if (!log_di || log_di == ERR_PTR(-ENOENT)) { > btrfs_dir_item_key_to_cpu(eb, di, &location); > btrfs_release_path(path); > btrfs_release_path(log_path); > @@ -5090,8 +5090,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, > * we don't need to do more work nor fallback to > * a transaction commit. > */ > - if (IS_ERR(other_inode) && > - PTR_ERR(other_inode) == -ENOENT) { > + if (other_inode == ERR_PTR(-ENOENT)) { > goto next_key; > } else if (IS_ERR(other_inode)) { > err = PTR_ERR(other_inode); >