Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4151815ybl; Sat, 21 Dec 2019 00:45:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyEjDEXtn/MNadls7K/vSzMvR0W8kIuLSpT7YRSnbz05Kn8aA5Iwn7UGMVtSLp/Ip/aaEf0 X-Received: by 2002:a05:6830:159a:: with SMTP id i26mr20171530otr.3.1576917925367; Sat, 21 Dec 2019 00:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576917925; cv=none; d=google.com; s=arc-20160816; b=Mlx3wZXRyV4zmmXZRpAuqmR3wzAi5Pexw9bx9gbCWGMSL+zSAOei58niwn+BnPn1gH MBckI7epD05baVYxFbrloubtuxdHx24HKnXr2Q2tkNfB5iiJt7WslrfPvkcQ5qvy67fj xrI9hDLVW0TjwKNiC572IfM6PbM+vp3eWh0z5eWoHXszXmgYO8z3jeSnm2PGU+LatEFT r0vEKghWzB/a9DD5WJDt0nTwewoQZV8BpBr580NbclautdJuenfdRK3/llIkSsRt9YXL kHJC0Q4qmdGcTTsjipMgj+12vzeFfzLr0AqNwSqUw6kA1ZHzAbxbCYklVkPTihXu6cb1 wivg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zOw1yXDHuAoD3Kc1PWQqOf8j8YrDutWX5kRyO7Mss4U=; b=v66ly3/5rS4WaDvHoEjTUGgHED1ZzuuxFwPviXl2qeUCrcG0nMSsJE3/Im2wMoZEp2 amg/wjhtAT9ho4w3RyrZfO02UWVJ5cJ0vg0rmS0MDIEGko4FawKjMy4QbGzZ7feo+BLw KvHeWh0qMBhEnabeWmKzw7T7bcVCMtY6OGXO+ZQr99OhCFSOT18FFqxp4bGv639trxuM BweFB3RISzQh09uj9b9WOSs2znRJANH3o/M8xStUaaxrARHeRlAkAdBnCBMonkfqocG6 YBx66D7lwRzh+O5reaz1QURHq5yLsSmBwQCUEXt8AUZcRgOUr6pmy0M0CKAl0PLyfZKt GOWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h2L5Hfmv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i65si5102409oif.15.2019.12.21.00.45.13; Sat, 21 Dec 2019 00:45:25 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h2L5Hfmv; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbfLUInR (ORCPT + 99 others); Sat, 21 Dec 2019 03:43:17 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:44061 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbfLUInR (ORCPT ); Sat, 21 Dec 2019 03:43:17 -0500 Received: by mail-il1-f194.google.com with SMTP id z12so10016839iln.11; Sat, 21 Dec 2019 00:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zOw1yXDHuAoD3Kc1PWQqOf8j8YrDutWX5kRyO7Mss4U=; b=h2L5Hfmvy1e383vZXY/Uf95l/jjjw7B683GAwoSUYotqjNgmDAc2xOiOz9Fg5x1L+t dF4kDHkoQH/8cBz9/I2Zk/J/zvL53i/sMpJDZ/7EQEw9UrcsgNx/dlVwHRLxcZAgExWG wYNFyWL/aM1sBjKCLjG9nMybZbueHleyN9e2f7tboSWCX2OKLKtyOGRqxNlsY0N1iWBu R0wtB3eomjuaKsX8uOxlc+CAdQ6HyRVYSrWGDlWYoRBqILJkJG/IojdWQqvqChLq/BCz RKkGroylvhdoYNl7b3kqAKArBg3aoI0JMkTUnUziLXaCUF7bkvY8yly9wZGmKb8P7i1Y MWwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zOw1yXDHuAoD3Kc1PWQqOf8j8YrDutWX5kRyO7Mss4U=; b=sROY7dq1TQclU7ZyQjXqwSZJcWra45MDP6vm3Z076qMC9xXN2OVz0yH3JmoNcgfzfR 7/aEa5UC6I2DWcu6BjnEhhs5RbjYXz7AUGPkCOhqzFbP1KTkv3yO7kHVGRi62RV4AEXv tw5ezeJUx+DqPzJTpqtkY9WS3gYNukrVeYLTtzRutFNrt28qV3iloDchu6DzdfMCGu0O lKRAZ1xwnXXd6zF1mIL6adYguot3xUjMmXrLisTG5YawK/zlwQjCVK2iumiwEKc7j2Cs y2RPUB2aGMKghcAImPuwfXDDrOE3r+pmybc02nTJBafa+lhsR11Sz/XWR/Lb5ih4B3Vx bChA== X-Gm-Message-State: APjAAAVK4ojIRJsJ46fSjdIegwBy0pUI0uxqnanenckPRD99wET/bRJw 0FIYoUGBG5+gLPB4uM5q+ixrmhbBEkgJHiDc2gU= X-Received: by 2002:a92:d5c3:: with SMTP id d3mr15993083ilq.250.1576917796474; Sat, 21 Dec 2019 00:43:16 -0800 (PST) MIME-Version: 1.0 References: <20191220024936.GA380394@chrisdown.name> <20191220213052.GB7476@magnolia> In-Reply-To: <20191220213052.GB7476@magnolia> From: Amir Goldstein Date: Sat, 21 Dec 2019 10:43:05 +0200 Message-ID: Subject: Re: [PATCH] fs: inode: Reduce volatile inode wraparound risk when ino_t is 64 bit To: "Darrick J. Wong" Cc: Chris Down , linux-fsdevel , Al Viro , Jeff Layton , Johannes Weiner , Tejun Heo , linux-kernel , kernel-team@fb.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 20, 2019 at 11:33 PM Darrick J. Wong wrote: > > On Fri, Dec 20, 2019 at 02:49:36AM +0000, Chris Down wrote: > > In Facebook production we are seeing heavy inode number wraparounds on > > tmpfs. On affected tiers, in excess of 10% of hosts show multiple files > > with different content and the same inode number, with some servers even > > having as many as 150 duplicated inode numbers with differing file > > content. > > > > This causes actual, tangible problems in production. For example, we > > have complaints from those working on remote caches that their > > application is reporting cache corruptions because it uses (device, > > inodenum) to establish the identity of a particular cache object, but > > ...but you cannot delete the (dev, inum) tuple from the cache index when > you remove a cache object?? > > > because it's not unique any more, the application refuses to continue > > and reports cache corruption. Even worse, sometimes applications may not > > even detect the corruption but may continue anyway, causing phantom and > > hard to debug behaviour. > > > > In general, userspace applications expect that (device, inodenum) should > > be enough to be uniquely point to one inode, which seems fair enough. > > Except that it's not. (dev, inum, generation) uniquely points to an > instance of an inode from creation to the last unlink. > Yes, but also: There should not exist two live inodes on the system with the same (dev, inum) The problem is that ino 1 may still be alive when wraparound happens and then two different inodes with ino 1 exist on same dev. Take the 'diff' utility for example, it will report that those files are identical if they have the same dev,ino,size,mtime. I suspect that 'mv' will not let you move one over the other, assuming they are hardlinks. generation is not even exposed to legacy application using stat(2). Thanks, Amir.