From patchwork Wed Mar 16 13:05:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jordi Pujol X-Patchwork-Id: 8599861 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 539E49F44D for ; Wed, 16 Mar 2016 13:05:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5CAC2034B for ; Wed, 16 Mar 2016 13:05:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0434F202FE for ; Wed, 16 Mar 2016 13:05:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934264AbcCPNFU (ORCPT ); Wed, 16 Mar 2016 09:05:20 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:38737 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbcCPNFT (ORCPT ); Wed, 16 Mar 2016 09:05:19 -0400 Received: by mail-wm0-f44.google.com with SMTP id l68so71569472wml.1 for ; Wed, 16 Mar 2016 06:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version; bh=cJOPppk09+eovOAtCyEWaugd/Lpsp504XYv7nRXlXvI=; b=rVM+Z0qBwfYswuB5lE7QiLOSjTUCoJjPrFqoretT4zNnh4ksqhpJ4i/LfhRNYi/y0C kxplHHvVgOa1ZRJ04JpMZ2wi2+M9dIP1ueDVdJzeB2z3O2ihAnVZCCeVSZS4ghWmY0de Vj7lsxRuLYc8Nofcot+x3OOKMFD47DHYVtouAb3GeKBxbjJ4DeZ//J5sCrOJeb8jS5I3 qlfeFoeQ4VE25C5CkEy2s+WdEa8MjP+rVsO3G/z/UHhy191ch0gQyoQSw0GQej33feP+ UzUuwg1trN/DqQsC61T/09R0jJQfKNuWbMBNxH3emnGCW3K8kSZDjNVi/wrnd2hgnE92 hAZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:subject:message-id:mime-version; bh=cJOPppk09+eovOAtCyEWaugd/Lpsp504XYv7nRXlXvI=; b=RU/FxtgJNX8AdbS8NBlo98MJ71X4DbXzpqVLZpdCaECKMVFgehypUnV8I9D1OZslnE N6vrv+tXrrYXUeHgPejmOMhaFHnB86sOSXJtDLpeoteGVuF8Mh++qTtYdKwfkZv7fh28 pIehPXnJ4qf2kdc3BO8k1mggZTKuFqw0ykJbn37YF59eSzgyCOBYg+CXrpUXIlozjQrn tBRcxx2TMiKcempbWNH2TQ2A+HmNmmL37jds0SdMoAtMy0KW1g4Yvakm4sNhdgX5W7rS fuszi5gGhAKxlVrudl9b1UA27HbdYdAtEDxbZqu+DlC39s1aOmwFM2Hsfx6B2H3onFMI EowQ== X-Gm-Message-State: AD7BkJK1RpoFMtqKSFfNrZuoUI9O8xmJCX1WTewLMqgtFIsF6PgMuXRDPtYuLQ8RAcQSow== X-Received: by 10.28.9.19 with SMTP id 19mr30843630wmj.87.1458133518037; Wed, 16 Mar 2016 06:05:18 -0700 (PDT) Received: from localdomain (196.red-88-16-178.dynamicip.rima-tde.net. [88.16.178.196]) by smtp.gmail.com with ESMTPSA id i1sm2950948wjs.45.2016.03.16.06.05.17 for (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2016 06:05:17 -0700 (PDT) Date: Wed, 16 Mar 2016 14:05:14 +0100 From: Jordi Pujol Palomer To: Linux-Fsdevel Subject: [PATCH] fs/namei.c: Hard link and rename should check same device instead of same mount Message-ID: <20160316140514.778db799@localdomain> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, T_TVD_MIME_EPI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, Working on a Linux system that bind mounts some directories, have found frequent errors when moving files between directories that belong to different mount points but are on the same device. The two attached patches solve these problems on a local filesystem. Maybe we must test it on different configurations. Thanks, Jordi Pujol i Palomer Enginyer Tècnic Industrial Signed-off-by: Jordi Pujol Palomer --- Subject: fs: Rename must check same device instead of same mount Date: Wed, 16 Mar 2016 09:12:21 +0100 --- linux-4.5.0-a/fs/namei.c +++ linux-4.5.0-b/fs/namei.c 2016-03-15 22:15:03.275460823 +0100 @@ -4424,7 +4424,7 @@ retry: } error = -EXDEV; - if (old_path.mnt != new_path.mnt) + if (old_path.dentry->d_sb->s_dev != new_path.dentry->d_sb->s_dev) goto exit2; error = -EBUSY;