From patchwork Tue Aug 26 15:04:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 4782861 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82E98C0338 for ; Tue, 26 Aug 2014 15:04:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF9C32011D for ; Tue, 26 Aug 2014 15:04:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BE6E520114 for ; Tue, 26 Aug 2014 15:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbaHZPE4 (ORCPT ); Tue, 26 Aug 2014 11:04:56 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:42310 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751665AbaHZPEz (ORCPT ); Tue, 26 Aug 2014 11:04:55 -0400 Received: by mail-la0-f44.google.com with SMTP id el20so15236978lab.31 for ; Tue, 26 Aug 2014 08:04:53 -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; bh=OXxvmfUJD7smo9Ys/7LpVu5TNpr+13MReov1LtaKgc8=; b=mXVq9DmkRXzGxWIESv6uiMtSMCrXuNd1iumI2pTTksOKpKXF/pmFVa2NdcZtkZ4dq7 hXH8+R/G4V6Z+RD9W106FXugN97DBm/0mqebb8Gp48rjIGHsDqcOU1gm7bEs2ksepUWO 5Bc45O8OUF8ibVNYirqd1DSuZQBb2i8CB/dBj47p6Bg8uJB98zzlC6SGy4La56jYG//u xYWQoaHbvYtVQO+m9AwaDSkNiozhRySo/gxW5J0BYky9DX6gdW40H7sKALgIV7kLo/Xn hDt3j8Up1rJbF70buCC6zOuX/CAWgHREXW/Z+6cBAMbflRa6x6nNgzVwl303ZfMSZ0H2 f/nw== X-Received: by 10.152.87.81 with SMTP id v17mr18124624laz.17.1409065493603; Tue, 26 Aug 2014 08:04:53 -0700 (PDT) Received: from localhost.localdomain ([92.43.3.124]) by mx.google.com with ESMTPSA id yx5sm5556329lbb.35.2014.08.26.08.04.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 26 Aug 2014 08:04:52 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Cc: Subject: [PATCH v2] CIFS: Fix wrong restart readdir for SMB1 Date: Tue, 26 Aug 2014 19:04:44 +0400 Message-Id: <1409065484-7438-1-git-send-email-pshilovsky@samba.org> X-Mailer: git-send-email 1.9.1 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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 The existing code calls server->ops->close() that is not right. This causes XFS test generic/310 to fail. Fix this by using server->ops->closedir() function. Cc: # v3.7+ Signed-off-by: Dan Carpenter Signed-off-by: Pavel Shilovsky --- fs/cifs/readdir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 798c80a..b334a89 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -596,8 +596,8 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos, if (server->ops->dir_needs_close(cfile)) { cfile->invalidHandle = true; spin_unlock(&cifs_file_list_lock); - if (server->ops->close) - server->ops->close(xid, tcon, &cfile->fid); + if (server->ops->close_dir) + server->ops->close_dir(xid, tcon, &cfile->fid); } else spin_unlock(&cifs_file_list_lock); if (cfile->srch_inf.ntwrk_buf_start) {