From patchwork Mon Aug 18 16:49:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4737911 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 488049F377 for ; Mon, 18 Aug 2014 16:50:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CA0520131 for ; Mon, 18 Aug 2014 16:50:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34034200E9 for ; Mon, 18 Aug 2014 16:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbaHRQux (ORCPT ); Mon, 18 Aug 2014 12:50:53 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33734 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbaHRQux (ORCPT ); Mon, 18 Aug 2014 12:50:53 -0400 Received: by mail-lb0-f171.google.com with SMTP id l4so4384830lbv.2 for ; Mon, 18 Aug 2014 09:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=pIgAnG31w6niWrwt7hkS8EXS4ozB4DvM4ApB3bmA8u8=; b=c6OD2bWEN7klpXz0rpXOOt5c3XiFSbLYRT2iWTWaZfFRjgr+dUjwqiBFh4Y/+AlBb7 DZdpUfGj83GfqAb4OjohDmjANverXX4Xzhq+P7hOF21sIH1NvrvY2Kd+X7DyW5dlzjSO dw35tBSO2BMq0X/cldEF9XQ8tbWT3ukWybQUs951iu35L2W6MXAbiwCAP0s9LUaL8Xp6 8PLOPt7BDZunLxApkVNHUsoOZ6fuZLabbX24r+8JwkJWAE6+DrGCE+/6ce+jaVvDjf1I ZS08nr0DC6lZe7b86NtL+MDd30P59lH/Cv4uTIJsQkEnpIR67ioCZw+9sXJ34+k1umEy Q58A== X-Received: by 10.152.45.101 with SMTP id l5mr30586745lam.20.1408380651363; Mon, 18 Aug 2014 09:50:51 -0700 (PDT) Received: from localhost.localdomain ([85.26.235.174]) by mx.google.com with ESMTPSA id cj12sm10849508lad.38.2014.08.18.09.50.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Aug 2014 09:50:49 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Subject: [PATCH 2/2] CIFS: Fix wrong directory attributes after rename Date: Mon, 18 Aug 2014 20:49:58 +0400 Message-Id: <1408380598-11737-2-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1408380598-11737-1-git-send-email-pshilovsky@samba.org> References: <1408380598-11737-1-git-send-email-pshilovsky@samba.org> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 When we requests rename we also need to update attributes of both source and target parent directories. Not doing it causes generic/309 xfstest to fail on SMB2 mounts. Fix this by marking these directories for force revalidating. Cc: Signed-off-by: Pavel Shilovsky --- fs/cifs/inode.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 2029e7c..cf69c95 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1720,6 +1720,12 @@ unlink_target: target_dentry, to_name); } + /* force revalidate to go get info when needed */ + CIFS_I(source_dir)->time = CIFS_I(target_dir)->time = 0; + + source_dir->i_ctime = source_dir->i_mtime = target_dir->i_ctime = + target_dir->i_mtime = current_fs_time(source_dir->i_sb); + cifs_rename_exit: kfree(info_buf_source); kfree(from_name);