Whamcloud - gitweb
b=14712
authorgreen <green>
Thu, 24 Apr 2008 05:58:37 +0000 (05:58 +0000)
committergreen <green>
Thu, 24 Apr 2008 05:58:37 +0000 (05:58 +0000)
r=vitaly,shadow

Do not free request that we do not have refcount on on open error

lustre/ChangeLog
lustre/llite/file.c

index 023f778..85c143c 100644 (file)
@@ -519,6 +519,13 @@ Bugzilla   : 15566
 Description: Update an obsolete wirecheck.c generator
 Details    : Update wirecheck.c/wirehdr.c and regenerate wiretest.c
 
+Severity   : normal
+Bugzilla   : 14712
+Description: Client can panic on open sometimes
+Details    : It is possible that we try to free already freed request in
+             ll_file_open in some error cases when we send request from
+            ll_file_open
+
 --------------------------------------------------------------------------------
 
 2007-12-07         Cluster File Systems, Inc. <info@clusterfs.com>
index d50d49a..ddaa5ab 100644 (file)
@@ -486,8 +486,9 @@ restart:
                            let's close it somehow. This will decref request. */
                         rc = it_open_error(DISP_OPEN_OPEN, it);
                         if (rc) {
+                                up(&lli->lli_och_sem);
                                 ll_file_data_put(fd);
-                                GOTO(out_och_free, rc);
+                                GOTO(out_openerr, rc);
                         }       
                         ll_release_openhandle(file->f_dentry, it);
                         lprocfs_counter_incr(ll_i2sbi(inode)->ll_stats, 
@@ -513,11 +514,6 @@ restart:
                                 GOTO(out_openerr, rc);
                         }
 
-                        /* Got some error? Release the request */
-                        if (it->d.lustre.it_status < 0) {
-                                req = it->d.lustre.it_data;
-                                ptlrpc_req_finished(req);
-                        }
                         mdc_set_lock_data(&it->d.lustre.it_lock_handle,
                                           file->f_dentry->d_inode);
                         goto restart;