From: Johann Lombardi Date: Mon, 7 Mar 2011 16:55:23 +0000 (+0100) Subject: LU-114 use ll_lookup_one_len() instead of lookup_one_len() in sptlrpc_target_local_co... X-Git-Tag: 2.0.59-llnl3-base~16 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;ds=sidebyside;h=d0912bb3a0bf5a14002fb96047c3ea4ce1bfbc0e;p=fs%2Flustre-release.git LU-114 use ll_lookup_one_len() instead of lookup_one_len() in sptlrpc_target_local_copy_conf() should lock the parent dir when doing lookup Recent kernels print a warning when lookup_one_len() is called w/o the parent dir locked. sptlrpc_target_local_copy_conf() should not call lookup_one_len() directly, but ll_lookup_one_len() instead which locks the parent dir for you and also checks for bad inode. Change-Id: I4d020c55382238bbbc6df6017f54b5b585f53c48 Signed-off-by: Johann Lombardi Reviewed-on: http://review.whamcloud.com/303 Tested-by: Hudson Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 0acb373..18a247b 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1482,7 +1482,8 @@ struct dentry *filter_fid2dentry(struct obd_device *obd, } CDEBUG(D_INODE, "looking up object O/%.*s/%s\n", dparent->d_name.len, dparent->d_name.name, name); - dchild = /*ll_*/lookup_one_len(name, dparent, len); + /* dparent is already locked here, so we cannot use ll_lookup_one_len() */ + dchild = lookup_one_len(name, dparent, len); if (dir_dentry == NULL) filter_parent_unlock(dparent); if (IS_ERR(dchild)) { diff --git a/lustre/ptlrpc/sec_config.c b/lustre/ptlrpc/sec_config.c index a8b9630..5af3690 100644 --- a/lustre/ptlrpc/sec_config.c +++ b/lustre/ptlrpc/sec_config.c @@ -1031,8 +1031,8 @@ int sptlrpc_target_local_copy_conf(struct obd_device *obd, push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); - dentry = lookup_one_len(MOUNT_CONFIGS_DIR, cfs_fs_pwd(current->fs), - strlen(MOUNT_CONFIGS_DIR)); + dentry = ll_lookup_one_len(MOUNT_CONFIGS_DIR, cfs_fs_pwd(current->fs), + strlen(MOUNT_CONFIGS_DIR)); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot lookup %s directory: rc = %d\n",