From owner-freebsd-hackers@freebsd.org Thu Mar 2 23:21:15 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14166CF591F; Thu, 2 Mar 2017 23:21:15 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: from mail-qk0-x241.google.com (mail-qk0-x241.google.com [IPv6:2607:f8b0:400d:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C56901672; Thu, 2 Mar 2017 23:21:14 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: by mail-qk0-x241.google.com with SMTP id m67so5584956qkf.3; Thu, 02 Mar 2017 15:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uP4igptuyWpR3a4fmaZB2neJBDS0fRI0jyaa+L/fvVo=; b=SDPn75G2GVyMsEl9ZD0E9py0Yvn9if5LY8cJw6QXgfoCNLxJqo8Q1Dzk/1fU6EcIph 7BaBhT5n6a/KtyPO65q01vJoIqE9H1oH2TEz+CwjUp6Pf1V2j3Dr9E541VvjatwP6h2R Vhr/EAlfMt+lDb2Jf/7HmjBqdxm9QzBwZ7cumWqo8R5j6+trr7XQtptZUC74ivMDPHFF GWvJ77kNc69/RKoCNABIL4ZIQNYA4PJpzFW6nAXB1JHsh44VnhMuGYmue8ITv3ezDGl4 qiwMkVRlMqusRxqGyo0EEX6pUYU+L6K58TZagzBwKA3yhBDcMA53MNo0WAZBdC2x5ElR n3rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uP4igptuyWpR3a4fmaZB2neJBDS0fRI0jyaa+L/fvVo=; b=RGMjTAcdLJBBiOsLVJjp4MpugYS9p+1KV9fqZ2mU77OKPKTOdQkXCC/x0gA4Y7FeQd PByU3SsLDYgGHvHVqDBh/nuXwHnDgoHFP7qGPUmqkvuttro+/Kq34fl5NKE8C4oTUwjj EaVnBQ25c533/OYd/a/MLv8vkwd3WfzLKqWkwVwjEsxLsUBLDvHC1hWRbY/11fhlo5ly 168A06TNOnKv6TK6ZUK/x+Phzeedk+nAzogc2YTYjhWQOMXTsDcMCl8qHOSXOfl7dUth FeyzcXAF3+PaLytc5Vy0W4pA9IBu5PeNLhyyhqhoY4O0BxEcf2JXt/nDPsJ7nG+8FgG9 KCng== X-Gm-Message-State: AMke39mVqZWlPLjCR+7EUy1pGgHB2mQBt8q/HzDYJMxtmSvDsG0nUHVUnOwzETB4hDcWyGHi0RQkEtg7pt2Wpw== X-Received: by 10.237.36.116 with SMTP id s49mr20418789qtc.128.1488496873968; Thu, 02 Mar 2017 15:21:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.134.70 with HTTP; Thu, 2 Mar 2017 15:21:13 -0800 (PST) In-Reply-To: <20170302230416.GK4503@server.rulingia.com> References: <20170302230416.GK4503@server.rulingia.com> From: Subbsd Date: Fri, 3 Mar 2017 02:21:13 +0300 Message-ID: Subject: Re: effect of strip(1) on du(1) To: Peter Jeremy Cc: freebsd-current Current , freebsd-hackers Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 23:21:15 -0000 On Fri, Mar 3, 2017 at 2:04 AM, Peter Jeremy wrote: > On 2017-Mar-02 22:29:46 +0300, Subbsd wrote: >>During some interval after strip call, du will show 512B for any file. >>If execute du(1) after strip(1) without delay, this behavior is reproduced 100%: > > What filesystem are you using? strip(1) rewrites the target file and du(1) > reports the number of blocks reported by stat(2). It seems that you are > hitting a situation where the file metadata isn't immediately updated. > > -- > Peter Jeremy Got it. My filesystem is ZFS. Looks like when ZFS open and write data to file, we get wrong number of blocks during a small interval after writing. Thanks for pointing this out!