Whamcloud - gitweb
LU-10662 llite: Add exit for filedata allocation failed 96/31296/3
authorBen Evans <bevans@cray.com>
Tue, 13 Feb 2018 19:20:18 +0000 (14:20 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 6 Mar 2018 19:14:16 +0000 (19:14 +0000)
When the filedata allocation fails, we need to exit to
a later point than out_openerr, which calls
deauthorize_statahead and ll_file_data_put, neither of
which is valid. (This leads to a panic.)

Signed-off-by: Ben Evans <bevans@cray.com>
Change-Id: I670d578f01b2731761e3149db36dd8da1551a30a
Cray-bug-id: LUS-1321
Reviewed-on: https://review.whamcloud.com/31296
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alexandr Boyko <c17825@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/file.c

index 68adb40..e33d030 100644 (file)
@@ -526,7 +526,7 @@ int ll_file_open(struct inode *inode, struct file *file)
 
        fd = ll_file_data_get();
        if (fd == NULL)
-               GOTO(out_openerr, rc = -ENOMEM);
+               GOTO(out_nofiledata, rc = -ENOMEM);
 
        fd->fd_file = file;
        if (S_ISDIR(inode->i_mode))
@@ -695,6 +695,7 @@ out_openerr:
                 ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_OPEN, 1);
         }
 
+out_nofiledata:
        if (it && it_disposition(it, DISP_ENQ_OPEN_REF)) {
                ptlrpc_req_finished(it->it_request);
                it_clear_disposition(it, DISP_ENQ_OPEN_REF);