mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
target: Fix >= v3.9+ regression in PR APTPL + ALUA metadata write-out
This patch fixes a >= v3.9+ regression in __core_scsi3_write_aptpl_to_file() + core_alua_write_tpg_metadata() write-out, where a return value of -EIO was incorrectly being returned upon success. This bug was originally introduced in: commit0e9b10a90fAuthor: Al Viro <[email protected]> Date: Sat Feb 23 15:22:43 2013 -0500 target: writev() on single-element vector is pointless However, given that the return of core_scsi3_update_and_write_aptpl() was not used to determine if a command should be returned with non GOOD status, this bug was not being triggered in PR logic until v3.11-rc1 by commit: commit459f213ba1Author: Andy Grover <[email protected]> Date: Thu May 16 10:41:02 2013 -0700 target: Allocate aptpl_buf inside update_and_write_aptpl() So, go ahead and only return -EIO if kernel_write() returned a negative value. Reported-by: Gera Kazakov <[email protected]> Signed-off-by: Gera Kazakov <[email protected]> Cc: Al Viro <[email protected]> Cc: Andy Grover <[email protected]> Cc: [email protected] # 3.9+ Signed-off-by: Nicholas Bellinger <[email protected]>
This commit is contained in:
parent
38f7d6edbf
commit
f730f9158f
2 changed files with 2 additions and 2 deletions
|
|
@ -733,7 +733,7 @@ static int core_alua_write_tpg_metadata(
|
|||
if (ret < 0)
|
||||
pr_err("Error writing ALUA metadata file: %s\n", path);
|
||||
fput(file);
|
||||
return ret ? -EIO : 0;
|
||||
return (ret < 0) ? -EIO : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1949,7 +1949,7 @@ static int __core_scsi3_write_aptpl_to_file(
|
|||
pr_debug("Error writing APTPL metadata file: %s\n", path);
|
||||
fput(file);
|
||||
|
||||
return ret ? -EIO : 0;
|
||||
return (ret < 0) ? -EIO : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue