From: pschwan Date: Sun, 6 Oct 2002 00:24:44 +0000 (+0000) Subject: b=618962 X-Git-Tag: v1_7_100~4582 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=432511ec25253bbdac160f676983054ffdfe9131;p=fs%2Flustre-release.git b=618962 - Temporary fix for 618962 by handling OPEN intents in revalidate --- diff --git a/lustre/llite/dcache.c b/lustre/llite/dcache.c index a0274d6..af5e1e6 100644 --- a/lustre/llite/dcache.c +++ b/lustre/llite/dcache.c @@ -1,11 +1,22 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * This code is issued under the GNU General Public License. - * See the file COPYING in this distribution + * Copyright (c) 2001, 2002 Cluster File Systems, Inc. * - * Copyright (C) 2001, 2002 Cluster File Systems, Inc. + * This file is part of Lustre, http://www.lustre.org. * + * Lustre is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * Lustre is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Lustre; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include @@ -52,8 +63,13 @@ int ll_revalidate2(struct dentry *de, int flags, struct lookup_intent *it) struct obd_device *obddev; ENTRY; - if (it) - RETURN(0); /* lookups will have NULL it */ + /* right now we're only interested in IT_OPEN and IT_LOOKUP */ + if (it) { + CDEBUG(D_INFO, "name: %*s, intent: %s\n", de->d_name.len, + de->d_name.name, ldlm_it2str(it->it_op)); + if (!(it->it_op & IT_OPEN)) + RETURN(0); + } if (!de->d_inode) RETURN(0); @@ -75,6 +91,15 @@ int ll_revalidate2(struct dentry *de, int flags, struct lookup_intent *it) RETURN(1); } + /* If we're acting on an IT_OPEN intent and the file is already open, + * we won't get called in lookup2 if we return 0, so return 1. + * + * This is a temporary fix for bug 618962, but is one of the causes of + * 619078. */ + CDEBUG(D_INFO, "d_count: %d\n", atomic_read(&de->d_count)); + if (atomic_read(&de->d_count) > 0) + RETURN(1); + RETURN(0); } diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 81e096f..4170e6b 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -120,9 +120,7 @@ static int ll_file_open(struct inode *inode, struct file *file) file->private_data = fd; - EXIT; - - return 0; + RETURN(0); out_mdc: mdc_close(&sbi->ll_mdc_conn, inode->i_ino, S_IFREG, &fd->fd_mdshandle, &req); diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index b948665..e050cee 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -164,8 +164,8 @@ static struct dentry *ll_lookup2(struct inode *dir, struct dentry *dentry, dentry->d_it = it; } - CDEBUG(D_INFO, "name: %*s, intent op: %d\n", dentry->d_name.len, - dentry->d_name.name, it->it_op); + CDEBUG(D_INFO, "name: %*s, intent: %s\n", dentry->d_name.len, + dentry->d_name.name, ldlm_it2str(it->it_op)); if (dentry->d_name.len > EXT2_NAME_LEN) RETURN(ERR_PTR(-ENAMETOOLONG));