Whamcloud - gitweb
LU-114 use ll_lookup_one_len() instead of lookup_one_len() in sptlrpc_target_local_co...
authorJohann Lombardi <johann@whamcloud.com>
Mon, 7 Mar 2011 16:55:23 +0000 (17:55 +0100)
committerOleg Drokin <green@whamcloud.com>
Thu, 17 Mar 2011 21:32:30 +0000 (14:32 -0700)
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 <johann@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/303
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/obdfilter/filter.c
lustre/ptlrpc/sec_config.c

index 0acb373..18a247b 100644 (file)
@@ -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);
         }
         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)) {
         if (dir_dentry == NULL)
                 filter_parent_unlock(dparent);
         if (IS_ERR(dchild)) {
index a8b9630..5af3690 100644 (file)
@@ -1031,8 +1031,8 @@ int sptlrpc_target_local_copy_conf(struct obd_device *obd,
 
         push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
 
 
         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",
         if (IS_ERR(dentry)) {
                 rc = PTR_ERR(dentry);
                 CERROR("cannot lookup %s directory: rc = %d\n",