[PATCH 5/6] staging: rtl8188eu: remove EFUSE_GetEfuseDefinition function

2016-06-19 Thread Ivan Safonov
This function does not used.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c| 63 ---
 drivers/staging/rtl8188eu/include/rtw_efuse.h |  2 -
 2 files changed, 65 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index e783102..6532441 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -317,69 +317,6 @@ void efuse_ReadEFuse(struct adapter *Adapter, u8 
efuseType, u16 _offset, u16 _si
}
 }
 
-/* Do not support BT */
-void EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType, u8 type, 
void *pOut)
-{
-   switch (type) {
-   case TYPE_EFUSE_MAX_SECTION:
-   {
-   u8 *pMax_section;
-   pMax_section = pOut;
-   *pMax_section = EFUSE_MAX_SECTION_88E;
-   }
-   break;
-   case TYPE_EFUSE_REAL_CONTENT_LEN:
-   {
-   u16 *pu2Tmp;
-   pu2Tmp = pOut;
-   *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E;
-   }
-   break;
-   case TYPE_EFUSE_CONTENT_LEN_BANK:
-   {
-   u16 *pu2Tmp;
-   pu2Tmp = pOut;
-   *pu2Tmp = EFUSE_REAL_CONTENT_LEN_88E;
-   }
-   break;
-   case TYPE_AVAILABLE_EFUSE_BYTES_BANK:
-   {
-   u16 *pu2Tmp;
-   pu2Tmp = pOut;
-   *pu2Tmp = 
(u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E);
-   }
-   break;
-   case TYPE_AVAILABLE_EFUSE_BYTES_TOTAL:
-   {
-   u16 *pu2Tmp;
-   pu2Tmp = pOut;
-   *pu2Tmp = 
(u16)(EFUSE_REAL_CONTENT_LEN_88E-EFUSE_OOB_PROTECT_BYTES_88E);
-   }
-   break;
-   case TYPE_EFUSE_MAP_LEN:
-   {
-   u16 *pu2Tmp;
-   pu2Tmp = pOut;
-   *pu2Tmp = (u16)EFUSE_MAP_LEN_88E;
-   }
-   break;
-   case TYPE_EFUSE_PROTECT_BYTES_BANK:
-   {
-   u8 *pu1Tmp;
-   pu1Tmp = pOut;
-   *pu1Tmp = (u8)(EFUSE_OOB_PROTECT_BYTES_88E);
-   }
-   break;
-   default:
-   {
-   u8 *pu1Tmp;
-   pu1Tmp = pOut;
-   *pu1Tmp = 0;
-   }
-   break;
-   }
-}
-
 u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 efuse_addr, u8 
word_en, u8 *data)
 {
u16 tmpaddr = 0;
diff --git a/drivers/staging/rtl8188eu/include/rtw_efuse.h 
b/drivers/staging/rtl8188eu/include/rtw_efuse.h
index 9bfb10c..9e7d135 100644
--- a/drivers/staging/rtl8188eu/include/rtw_efuse.h
+++ b/drivers/staging/rtl8188eu/include/rtw_efuse.h
@@ -95,8 +95,6 @@ struct efuse_hal {
 };
 
 u8 Efuse_CalculateWordCnts(u8 word_en);
-void EFUSE_GetEfuseDefinition(struct adapter *adapt, u8 type, u8 type1,
- void *out);
 u8 efuse_OneByteRead(struct adapter *adapter, u16 addr, u8 *data);
 u8 efuse_OneByteWrite(struct adapter *adapter, u16 addr, u8 data);
 
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_EFUSE_MAX_SECTION, ) with a = EFUSE_MAX_SECTION_88E

2016-06-19 Thread Ivan Safonov
This makes the code easier to read.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 9d5bd43..1e96a81 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -483,14 +483,11 @@ int Efuse_PgPacketRead(struct adapter *pAdapter, u8 
offset, u8 *data)
u8 hoffset = 0, hworden = 0;
u8 tmpidx = 0;
u8 tmpdata[8];
-   u8 max_section = 0;
u8 tmp_header = 0;
 
-   EFUSE_GetEfuseDefinition(pAdapter, EFUSE_WIFI, TYPE_EFUSE_MAX_SECTION, 
(void *)_section);
-
if (!data)
return false;
-   if (offset > max_section)
+   if (offset > EFUSE_MAX_SECTION_88E)
return false;
 
memset(data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: rtl8188eu: remove _EFUSE_DEF_TYPE enum

2016-06-19 Thread Ivan Safonov
This enumeration does not used.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/include/rtw_efuse.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/rtw_efuse.h 
b/drivers/staging/rtl8188eu/include/rtw_efuse.h
index 9e7d135..168c12d 100644
--- a/drivers/staging/rtl8188eu/include/rtw_efuse.h
+++ b/drivers/staging/rtl8188eu/include/rtw_efuse.h
@@ -34,16 +34,6 @@
 #defineEFUSE_WIFI  0
 #defineEFUSE_BT1
 
-enum _EFUSE_DEF_TYPE {
-   TYPE_EFUSE_MAX_SECTION  = 0,
-   TYPE_EFUSE_REAL_CONTENT_LEN = 1,
-   TYPE_AVAILABLE_EFUSE_BYTES_BANK = 2,
-   TYPE_AVAILABLE_EFUSE_BYTES_TOTAL= 3,
-   TYPE_EFUSE_MAP_LEN  = 4,
-   TYPE_EFUSE_PROTECT_BYTES_BANK   = 5,
-   TYPE_EFUSE_CONTENT_LEN_BANK = 6,
-};
-
 /* E-Fuse */
 #define EFUSE_MAP_SIZE  512
 #define EFUSE_MAX_SIZE  256
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/6] staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_AVAILABLE_EFUSE_BYTES_BANK, ) call with a = (EFUSE_REAL_CONTENT_LEN_88E - EFUSE_OOB_PROTECT_BYTES_88E)

2016-06-19 Thread Ivan Safonov
This makes the code easier to read.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 1e96a81..e783102 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -588,12 +588,12 @@ static bool hal_EfuseFixHeaderProcess(struct adapter 
*pAdapter, u8 efuseType, st
 static bool hal_EfusePgPacketWrite2ByteHeader(struct adapter *pAdapter, u8 
efuseType, u16 *pAddr, struct pgpkt *pTargetPkt)
 {
bool bRet = false;
-   u16 efuse_addr = *pAddr, efuse_max_available_len = 0;
+   u16 efuse_addr = *pAddr;
+   u16 efuse_max_available_len =
+   EFUSE_REAL_CONTENT_LEN_88E - EFUSE_OOB_PROTECT_BYTES_88E;
u8 pg_header = 0, tmp_header = 0, pg_header_temp = 0;
u8 repeatcnt = 0;
 
-   EFUSE_GetEfuseDefinition(pAdapter, efuseType, 
TYPE_AVAILABLE_EFUSE_BYTES_BANK, (void *)_max_available_len);
-
while (efuse_addr < efuse_max_available_len) {
pg_header = ((pTargetPkt->offset & 0x07) << 5) | 0x0F;
efuse_OneByteWrite(pAdapter, efuse_addr, pg_header);
@@ -766,11 +766,11 @@ static bool hal_EfusePartialWriteCheck(struct adapter 
*pAdapter, u8 efuseType, u
bool bRet = false;
u8 i, efuse_data = 0, cur_header = 0;
u8 matched_wden = 0, badworden = 0;
-   u16 startAddr = 0, efuse_max_available_len = 0;
+   u16 startAddr = 0;
+   u16 efuse_max_available_len =
+   EFUSE_REAL_CONTENT_LEN_88E - EFUSE_OOB_PROTECT_BYTES_88E;
struct pgpkt curPkt;
 
-   EFUSE_GetEfuseDefinition(pAdapter, efuseType, 
TYPE_AVAILABLE_EFUSE_BYTES_BANK, (void *)_max_available_len);
-
rtw_hal_get_hwreg(pAdapter, HW_VAR_EFUSE_BYTES, (u8 *));
startAddr %= EFUSE_REAL_CONTENT_LEN;
 
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] staging: rtl8188eu: replace EFUSE_GetEfuseDefinition(..., TYPE_EFUSE_MAP_LEN, ...) call with it's result (EFUSE_MAP_LEN_88E)

2016-06-19 Thread Ivan Safonov
This makes the code easier to read.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 18 +++---
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index c17870c..ea28fa1 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -846,12 +846,7 @@ hal_EfusePgCheckAvailableAddr(
u8 efuseType
)
 {
-   u16 efuse_max_available_len = 0;
-
-   /* Change to check TYPE_EFUSE_MAP_LEN , because 8188E raw 256, logic 
map over 256. */
-   EFUSE_GetEfuseDefinition(pAdapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, 
(void *)_max_available_len);
-
-   if (Efuse_GetCurrentSize(pAdapter) >= efuse_max_available_len)
+   if (Efuse_GetCurrentSize(pAdapter) >= EFUSE_MAP_LEN_88E)
return false;
return true;
 }
@@ -977,13 +972,9 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 
*targetdata)
  */
 static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse)
 {
-   u16 mapLen = 0;
-
Efuse_PowerSwitch(pAdapter, false, true);
 
-   EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void 
*));
-
-   efuse_ReadEFuse(pAdapter, efuseType, 0, mapLen, Efuse);
+   efuse_ReadEFuse(pAdapter, efuseType, 0, EFUSE_MAP_LEN_88E, Efuse);
 
Efuse_PowerSwitch(pAdapter, false, false);
 }
@@ -996,12 +987,9 @@ void EFUSE_ShadowMapUpdate(
u8 efuseType)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
-   u16 mapLen = 0;
-
-   EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void 
*));
 
if (pEEPROM->bautoload_fail_flag)
-   memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
+   memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
else
Efuse_ReadAllMap(pAdapter, efuseType, 
pEEPROM->efuse_eeprom_data);
 }
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] staging: rtl8188eu: remove efuse_max variable in hal_EfusePartialWriteCheck

2016-06-19 Thread Ivan Safonov
This variable does not used after assigning value.

Signed-off-by: Ivan Safonov 
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c 
b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index ea28fa1..9d5bd43 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -769,11 +769,10 @@ static bool hal_EfusePartialWriteCheck(struct adapter 
*pAdapter, u8 efuseType, u
bool bRet = false;
u8 i, efuse_data = 0, cur_header = 0;
u8 matched_wden = 0, badworden = 0;
-   u16 startAddr = 0, efuse_max_available_len = 0, efuse_max = 0;
+   u16 startAddr = 0, efuse_max_available_len = 0;
struct pgpkt curPkt;
 
EFUSE_GetEfuseDefinition(pAdapter, efuseType, 
TYPE_AVAILABLE_EFUSE_BYTES_BANK, (void *)_max_available_len);
-   EFUSE_GetEfuseDefinition(pAdapter, efuseType, 
TYPE_EFUSE_REAL_CONTENT_LEN, (void *)_max);
 
rtw_hal_get_hwreg(pAdapter, HW_VAR_EFUSE_BYTES, (u8 *));
startAddr %= EFUSE_REAL_CONTENT_LEN;
-- 
2.7.3

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: unisys: visorbus: Replace semaphore with mutex

2016-06-19 Thread Binoy Jayan
The semaphore 'visordriver_callback_lock' is a simple mutex, so
it should be written as one. Semaphores are going away in the future.

Signed-off-by: Binoy Jayan 
---
 drivers/staging/unisys/include/visorbus.h   |  3 ++-
 drivers/staging/unisys/visorbus/visorbus_main.c | 14 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/include/visorbus.h 
b/drivers/staging/unisys/include/visorbus.h
index 9baf1ec..38edca8 100644
--- a/drivers/staging/unisys/include/visorbus.h
+++ b/drivers/staging/unisys/include/visorbus.h
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "periodic_work.h"
 #include "channel.h"
@@ -159,7 +160,7 @@ struct visor_device {
struct list_head list_all;
struct periodic_work *periodic_work;
bool being_removed;
-   struct semaphore visordriver_callback_lock;
+   struct mutex visordriver_callback_lock;
bool pausing;
bool resuming;
u32 chipset_bus_no;
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 3a147db..93996a5 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -544,10 +544,10 @@ dev_periodic_work(void *xdev)
struct visor_device *dev = xdev;
struct visor_driver *drv = to_visor_driver(dev->device.driver);
 
-   down(>visordriver_callback_lock);
+   mutex_lock(>visordriver_callback_lock);
if (drv->channel_interrupt)
drv->channel_interrupt(dev);
-   up(>visordriver_callback_lock);
+   mutex_unlock(>visordriver_callback_lock);
if (!visor_periodic_work_nextperiod(dev->periodic_work))
put_device(>device);
 }
@@ -588,7 +588,7 @@ visordriver_probe_device(struct device *xdev)
if (!drv->probe)
return -ENODEV;
 
-   down(>visordriver_callback_lock);
+   mutex_lock(>visordriver_callback_lock);
dev->being_removed = false;
 
res = drv->probe(dev);
@@ -598,7 +598,7 @@ visordriver_probe_device(struct device *xdev)
fix_vbus_dev_info(dev);
}
 
-   up(>visordriver_callback_lock);
+   mutex_unlock(>visordriver_callback_lock);
return res;
 }
 
@@ -614,11 +614,11 @@ visordriver_remove_device(struct device *xdev)
 
dev = to_visor_device(xdev);
drv = to_visor_driver(xdev->driver);
-   down(>visordriver_callback_lock);
+   mutex_lock(>visordriver_callback_lock);
dev->being_removed = true;
if (drv->remove)
drv->remove(dev);
-   up(>visordriver_callback_lock);
+   mutex_unlock(>visordriver_callback_lock);
dev_stop_periodic_work(dev);
 
put_device(>device);
@@ -778,7 +778,7 @@ create_visor_device(struct visor_device *dev)
POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, chipset_dev_no, chipset_bus_no,
 POSTCODE_SEVERITY_INFO);
 
-   sema_init(>visordriver_callback_lock, 1);  /* unlocked */
+   mutex_init(>visordriver_callback_lock);
dev->device.bus = _type;
dev->device.groups = visorbus_channel_groups;
device_initialize(>device);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: remove remote client support

2016-06-19 Thread James Simmons
From: Fan Yong 

There are several obsolete sub commands for lfs to work with
remote client. We do not support that anymore, and should be
deleted along with any kernel code related to remote client.

Signed-off-by: Fan Yong 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6971
Reviewed-on: http://review.whamcloud.com/19789
Reviewed-by: Andreas Dilger 
Reviewed-by: James Simmons 
Reviewed-by: Lai Siyao 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 .../lustre/lustre/include/lustre/lustre_idl.h  |   40 +--
 .../lustre/lustre/include/lustre/lustre_user.h |   15 +-
 .../staging/lustre/lustre/include/lustre_eacl.h|   11 -
 .../staging/lustre/lustre/include/lustre_export.h  |   13 -
 drivers/staging/lustre/lustre/include/lustre_net.h |1 -
 .../lustre/lustre/include/lustre_req_layout.h  |2 +-
 drivers/staging/lustre/lustre/include/obd.h|3 -
 drivers/staging/lustre/lustre/include/obd_class.h  |   10 -
 drivers/staging/lustre/lustre/llite/Makefile   |3 +-
 drivers/staging/lustre/lustre/llite/dir.c  |   29 +--
 drivers/staging/lustre/lustre/llite/file.c |   15 -
 .../staging/lustre/lustre/llite/llite_internal.h   |   88 +
 drivers/staging/lustre/lustre/llite/llite_lib.c|   69 +---
 drivers/staging/lustre/lustre/llite/llite_rmtacl.c |  295 --
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |6 +-
 drivers/staging/lustre/lustre/llite/remote_perm.c  |  320 ---
 drivers/staging/lustre/lustre/llite/super25.c  |   19 -
 drivers/staging/lustre/lustre/llite/xattr.c|   97 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   22 -
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |   21 +-
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |2 +-
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   76 +
 drivers/staging/lustre/lustre/obdclass/Makefile|3 +-
 drivers/staging/lustre/lustre/obdclass/acl.c   |  411 
 drivers/staging/lustre/lustre/osc/osc_cache.c  |5 +-
 drivers/staging/lustre/lustre/osc/osc_page.c   |4 +-
 drivers/staging/lustre/lustre/ptlrpc/layout.c  |   12 +-
 .../staging/lustre/lustre/ptlrpc/pack_generic.c|   13 -
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c|   48 ---
 29 files changed, 55 insertions(+), 1598 deletions(-)
 delete mode 100644 drivers/staging/lustre/lustre/llite/llite_rmtacl.c
 delete mode 100644 drivers/staging/lustre/lustre/llite/remote_perm.c
 delete mode 100644 drivers/staging/lustre/lustre/obdclass/acl.c

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index fac7215..051864c 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -1237,8 +1237,16 @@ void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb);
  */
 #define OBD_CONNECT_ATTRFID   0x4000ULL /*Server can GetAttr By Fid*/
 #define OBD_CONNECT_NODEVOH   0x8000ULL /*No open hndl on specl nodes*/
-#define OBD_CONNECT_RMT_CLIENT   0x1ULL /*Remote client */
-#define OBD_CONNECT_RMT_CLIENT_FORCE  0x2ULL /*Remote client by force */
+#define OBD_CONNECT_RMT_CLIENT   0x1ULL /* Remote client, never used
+ * in production. Removed in
+ * 2.9. Keep this flag to
+ * avoid reuse.
+ */
+#define OBD_CONNECT_RMT_CLIENT_FORCE  0x2ULL /* Remote client by force,
+ * never used in production.
+ * Removed in 2.9. Keep this
+ * flag to avoid reuse
+ */
 #define OBD_CONNECT_BRW_SIZE 0x4ULL /*Max bytes per rpc */
 #define OBD_CONNECT_QUOTA64  0x8ULL /*Not used since 2.4 */
 #define OBD_CONNECT_MDS_CAPA0x10ULL /*MDS capability */
@@ -1699,7 +1707,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 
lmm_magic)
 #define OBD_MD_FLXATTRLS (0x0020ULL) /* xattr list */
 #define OBD_MD_FLXATTRRM (0x0040ULL) /* xattr remove */
 #define OBD_MD_FLACL(0x0080ULL) /* ACL */
-#define OBD_MD_FLRMTPERM (0x0100ULL) /* remote permission */
+/* OBD_MD_FLRMTPERM (0x0100ULL) remote perm, obsolete */
 #define OBD_MD_FLMDSCAPA (0x0200ULL) /* MDS capability */
 #define OBD_MD_FLOSSCAPA (0x0400ULL) /* OSS capability */
 #define 

[PATCH 24/28] staging/lustre/llite: ll_revalidate_dentry update

2016-06-19 Thread Oleg Drokin
From: Oleg Drokin 

There are a couple of cases in ll_revalidate_dentry() where
we are pretty sure the dentry is valid, so check for them early
and save more expensive checks for later.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dcache.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index d964f4f..581a63a 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -302,6 +302,17 @@ static int ll_revalidate_dentry(struct dentry *dentry,
 {
struct inode *dir = d_inode(dentry->d_parent);
 
+   /* If this is intermediate component path lookup and we were able to get
+* to this dentry, then its lock has not been revoked and the
+* path component is valid.
+*/
+   if (lookup_flags & LOOKUP_PARENT)
+   return 1;
+
+   /* Symlink - always valid as long as the dentry was found */
+   if (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode))
+   return 1;
+
/*
 * if open is set, talk to MDS to make sure file is created if
 * necessary, because we can't do this in ->open() later since that's
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 20/28] staging/lustre/mdc: Zero atime in close RPC

2016-06-19 Thread Oleg Drokin
From: Niu Yawei 

While atime on close is supposed to only increase, there's
a bug in some older server versions where atime from a client
is taken no matter the value that allows a stale client atime
to overwrite a correct value.

Update atime in close rpc to 0 to help such servers out.

Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/19932
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8041
Reviewed-by: Andreas Dilger 
Reviewed-by: Jinshan Xiong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/mdc/mdc_lib.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c 
b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index 2703113..143bd76 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -467,6 +467,18 @@ void mdc_close_pack(struct ptlrpc_request *req, struct 
md_op_data *op_data)
rec = req_capsule_client_get(>rq_pill, _REC_REINT);
 
mdc_setattr_pack_rec(rec, op_data);
+   /*
+* The client will zero out local timestamps when losing the IBITS lock
+* so any new RPC timestamps will update the client inode's timestamps.
+* There was a defect on the server side which allowed the atime to be
+* overwritten by a zeroed-out atime packed into the close RPC.
+*
+* Proactively clear the MDS_ATTR_ATIME flag in the RPC in this case
+* to avoid zeroing the atime on old unpatched servers.  See LU-8041.
+*/
+   if (rec->sa_atime == 0)
+   rec->sa_valid &= ~MDS_ATTR_ATIME;
+
mdc_ioepoch_pack(epoch, op_data);
mdc_hsm_release_pack(req, op_data);
 }
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 21/28] staging/lustre/o2ib: Don't access NULL NI on failure path

2016-06-19 Thread Oleg Drokin
From: Doug Oucharek 

In kiblnd_passive_connect(), if we are failing the connection
attempt because we cannot find a valid NI (we have a NULL NI),
we were coring after the "goto fail" because the failure
path was assuming non-NULL NI.

This patch ensures we don't dereference a NULL NI on that
failure path.

Signed-off-by: Doug Oucharek 
Reviewed-on: http://review.whamcloud.com/19614
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8022
Reviewed-by: Dmitry Eremin 
Reviewed-by: James Simmons 
Reviewed-by: Matt Ezell 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index e32e43b..a585d22 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2525,12 +2525,14 @@ kiblnd_passive_connect(struct rdma_cm_id *cmid, void 
*priv, int priv_nob)
return 0;
 
  failed:
-   if (ni)
+   if (ni) {
lnet_ni_decref(ni);
+   rej.ibr_cp.ibcp_queue_depth =
+   kiblnd_msg_queue_size(version, ni);
+   rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni);
+   }
 
rej.ibr_version = version;
-   rej.ibr_cp.ibcp_queue_depth = kiblnd_msg_queue_size(version, ni);
-   rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni);
kiblnd_reject(cmid, );
 
return -ECONNREFUSED;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 19/28] staging/lustre/llite: ensure obd is effective in onu_upcall

2016-06-19 Thread Oleg Drokin
From: Yang Sheng 

The watched obd device may still not setup while onu_upcall
invoked. So we need verify it in cl_ocd_update.

Signed-off-by: Yang Sheng 
Reviewed-on: http://review.whamcloud.com/19597
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8027
Reviewed-by: Niu Yawei 
Reviewed-by: Lai Siyao 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/lcommon_misc.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/lcommon_misc.c 
b/drivers/staging/lustre/lustre/llite/lcommon_misc.c
index 8a508ed..f6be105 100644
--- a/drivers/staging/lustre/lustre/llite/lcommon_misc.c
+++ b/drivers/staging/lustre/lustre/llite/lcommon_misc.c
@@ -96,7 +96,8 @@ int cl_ocd_update(struct obd_device *host,
__u64 flags;
int   result;
 
-   if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME)) {
+   if (!strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME) &&
+   watched->obd_set_up && !watched->obd_stopping) {
cli = >u.cli;
lco = owner;
flags = cli->cl_import->imp_connect_data.ocd_connect_flags;
@@ -111,9 +112,10 @@ int cl_ocd_update(struct obd_device *host,
mutex_unlock(>lco_lock);
result = 0;
} else {
-   CERROR("unexpected notification from %s %s!\n",
+   CERROR("unexpected notification from %s %s 
(setup:%d,stopping:%d)!\n",
   watched->obd_type->typ_name,
-  watched->obd_name);
+  watched->obd_name, watched->obd_set_up,
+  watched->obd_stopping);
result = -EINVAL;
}
return result;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/28] staging/lustre/ptlrpc: lost bulk leads to a hang

2016-06-19 Thread Oleg Drokin
From: Vitaly Fertman 

The reverse order of request_out_callback() and reply_in_callback()
puts the RPC into UNREGISTERING state, which is waiting for RPC &
bulk md unlink, whereas only RPC md unlink has been called so far.
If bulk is lost, even expired_set does not check for UNREGISTERING
state.

The same for write if server returns an error.

This phase is ambiguous, split to UNREG_RPC and UNREG_BULK.

Signed-off-by: Vitaly Fertman 
Seagate-bug-id:  MRP-2953, MRP-3206
Reviewed-by: Andriy Skulysh 
Reviewed-by: Alexey Leonidovich Lyashkov 
Tested-by: Elena V. Gryaznova 
Reviewed-on: http://review.whamcloud.com/19953
Reviewed-by: Chris Horn 
Reviewed-by: Ann Koehler 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_net.h | 48 +---
 .../staging/lustre/lustre/include/obd_support.h|  3 +
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 64 +++---
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  3 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  4 +-
 5 files changed, 91 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index 523d082..3f43664 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -480,8 +480,9 @@ enum rq_phase {
RQ_PHASE_BULK  = 0xebc0de02,
RQ_PHASE_INTERPRET  = 0xebc0de03,
RQ_PHASE_COMPLETE   = 0xebc0de04,
-   RQ_PHASE_UNREGISTERING  = 0xebc0de05,
-   RQ_PHASE_UNDEFINED  = 0xebc0de06
+   RQ_PHASE_UNREG_RPC  = 0xebc0de05,
+   RQ_PHASE_UNREG_BULK = 0xebc0de06,
+   RQ_PHASE_UNDEFINED  = 0xebc0de07
 };
 
 /** Type of request interpreter call-back */
@@ -1263,6 +1264,8 @@ struct ptlrpc_cli_req {
time_t   cr_reply_deadline;
/** when req bulk unlink must finish. */
time_t   cr_bulk_deadline;
+   /** when req unlink must finish. */
+   time_t   cr_req_deadline;
/** Portal to which this request would be sent */
shortcr_req_ptl;
/** Portal where to wait for reply and where reply would be sent */
@@ -1318,6 +1321,7 @@ struct ptlrpc_cli_req {
 #define rq_real_sent   rq_cli.cr_sent_out
 #define rq_reply_deadline  rq_cli.cr_reply_deadline
 #define rq_bulk_deadline   rq_cli.cr_bulk_deadline
+#define rq_req_deadlinerq_cli.cr_req_deadline
 #define rq_nr_resend   rq_cli.cr_resend_nr
 #define rq_request_portal  rq_cli.cr_req_ptl
 #define rq_reply_portalrq_cli.cr_rep_ptl
@@ -1693,8 +1697,10 @@ ptlrpc_phase2str(enum rq_phase phase)
return "Interpret";
case RQ_PHASE_COMPLETE:
return "Complete";
-   case RQ_PHASE_UNREGISTERING:
-   return "Unregistering";
+   case RQ_PHASE_UNREG_RPC:
+   return "UnregRPC";
+   case RQ_PHASE_UNREG_BULK:
+   return "UnregBULK";
default:
return "?Phase?";
}
@@ -1721,7 +1727,7 @@ ptlrpc_rqphase2str(struct ptlrpc_request *req)
 #define DEBUG_REQ_FLAGS(req)   \
ptlrpc_rqphase2str(req),
\
FLAG(req->rq_intr, "I"), FLAG(req->rq_replied, "R"),\
-   FLAG(req->rq_err, "E"),  \
+   FLAG(req->rq_err, "E"), FLAG(req->rq_net_err, "e"), \
FLAG(req->rq_timedout, "X") /* eXpired */, FLAG(req->rq_resend, "S"),   
\
FLAG(req->rq_restart, "T"), FLAG(req->rq_replay, "P"),\
FLAG(req->rq_no_resend, "N"),  \
@@ -1729,7 +1735,7 @@ ptlrpc_rqphase2str(struct ptlrpc_request *req)
FLAG(req->rq_wait_ctx, "C"), FLAG(req->rq_hp, "H"),  \
FLAG(req->rq_committed, "M")
 
-#define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s%s%s%s"
+#define REQ_FLAGS_FMT "%s:%s%s%s%s%s%s%s%s%s%s%s%s%s"
 
 void _debug_req(struct ptlrpc_request *req,
struct libcfs_debug_msg_data *data, const char *fmt, ...)
@@ -2380,8 +2386,7 @@ static inline int ptlrpc_client_bulk_active(struct 
ptlrpc_request *req)
 
desc = req->rq_bulk;
 
-   if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
-   req->rq_bulk_deadline > ktime_get_real_seconds())
+   if (req->rq_bulk_deadline > ktime_get_real_seconds())
return 1;
 
if (!desc)
@@ -2728,13 +2733,20 @@ ptlrpc_rqphase_move(struct ptlrpc_request *req, enum 
rq_phase 

[PATCH 10/28] staging/lustre/ptlrpc: Remove __ptlrpc_request_bufs_pack

2016-06-19 Thread Oleg Drokin
From: Ben Evans 

Combine __ptlrpc_request_bufs_pack into ptlrpc_request_bufs_pack
because it was an unnecessary wrapper otherwise.

Signed-off-by: Ben Evans 
Reviewed-on: http://review.whamcloud.com/16765
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7269
Reviewed-by: Frank Zago 
Reviewed-by: Andreas Dilger 
Reviewed-by: John L. Hammond 
Reviewed-by: Chris Horn 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 34 ++-
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index ae1cef3..5d832eb 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -583,14 +583,19 @@ static void __ptlrpc_free_req_to_pool(struct 
ptlrpc_request *request)
spin_unlock(>prp_lock);
 }
 
-static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
- __u32 version, int opcode,
- int count, __u32 *lengths, char **bufs,
- struct ptlrpc_cli_ctx *ctx)
+int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
+__u32 version, int opcode, char **bufs,
+struct ptlrpc_cli_ctx *ctx)
 {
-   struct obd_import *imp = request->rq_import;
+   int count;
+   struct obd_import *imp;
+   __u32 *lengths;
int rc;
 
+   count = req_capsule_filled_sizes(>rq_pill, RCL_CLIENT);
+   imp = request->rq_import;
+   lengths = request->rq_pill.rc_area[RCL_CLIENT];
+
if (unlikely(ctx)) {
request->rq_cli_ctx = sptlrpc_cli_ctx_get(ctx);
} else {
@@ -598,15 +603,12 @@ static int __ptlrpc_request_bufs_pack(struct 
ptlrpc_request *request,
if (rc)
goto out_free;
}
-
sptlrpc_req_set_flavor(request, opcode);
 
rc = lustre_pack_request(request, imp->imp_msg_magic, count,
 lengths, bufs);
-   if (rc) {
-   LASSERT(!request->rq_pool);
+   if (rc)
goto out_ctx;
-   }
 
lustre_msg_add_version(request->rq_reqmsg, version);
request->rq_send_state = LUSTRE_IMP_FULL;
@@ -631,24 +633,14 @@ static int __ptlrpc_request_bufs_pack(struct 
ptlrpc_request *request,
lustre_msg_set_opc(request->rq_reqmsg, opcode);
 
return 0;
+
 out_ctx:
+   LASSERT(!request->rq_pool);
sptlrpc_cli_ctx_put(request->rq_cli_ctx, 1);
 out_free:
class_import_put(imp);
return rc;
 }
-
-int ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
-__u32 version, int opcode, char **bufs,
-struct ptlrpc_cli_ctx *ctx)
-{
-   int count;
-
-   count = req_capsule_filled_sizes(>rq_pill, RCL_CLIENT);
-   return __ptlrpc_request_bufs_pack(request, version, opcode, count,
- request->rq_pill.rc_area[RCL_CLIENT],
- bufs, ctx);
-}
 EXPORT_SYMBOL(ptlrpc_request_bufs_pack);
 
 /**
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 17/28] staging/lustre/llite: change it_data to it_request

2016-06-19 Thread Oleg Drokin
From: "John L. Hammond" 

Change the void *it_data member of struct lookup_intent to struct
ptlrpc_request *it_request.

Signed-off-by: John L. Hammond 
Reviewed-on: http://review.whamcloud.com/17070
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7403
Reviewed-by: Andreas Dilger 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_intent.h |  2 +-
 drivers/staging/lustre/lustre/llite/dcache.c  |  6 +++---
 drivers/staging/lustre/lustre/llite/dir.c |  2 +-
 drivers/staging/lustre/lustre/llite/file.c| 17 -
 drivers/staging/lustre/lustre/llite/namei.c   |  2 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c |  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c|  2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c   |  4 ++--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c |  6 +++---
 drivers/staging/lustre/lustre/mdc/mdc_request.c   |  2 +-
 10 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_intent.h 
b/drivers/staging/lustre/lustre/include/lustre_intent.h
index 3aed810..ed2b6c6 100644
--- a/drivers/staging/lustre/lustre/include/lustre_intent.h
+++ b/drivers/staging/lustre/lustre/include/lustre_intent.h
@@ -46,7 +46,7 @@ struct lookup_intent {
int it_lock_mode;
int it_remote_lock_mode;
__u64  it_remote_lock_handle;
-   void   *it_data;
+   struct ptlrpc_request *it_request;
unsigned intit_lock_set:1;
 };
 
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index c5789f7..d964f4f 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -233,13 +233,13 @@ void ll_intent_release(struct lookup_intent *it)
ll_intent_drop_lock(it);
/* We are still holding extra reference on a request, need to free it */
if (it_disposition(it, DISP_ENQ_OPEN_REF))
-   ptlrpc_req_finished(it->it_data); /* ll_file_open */
+   ptlrpc_req_finished(it->it_request); /* ll_file_open */
 
if (it_disposition(it, DISP_ENQ_CREATE_REF)) /* create rec */
-   ptlrpc_req_finished(it->it_data);
+   ptlrpc_req_finished(it->it_request);
 
it->it_disposition = 0;
-   it->it_data = NULL;
+   it->it_request = NULL;
 }
 
 void ll_invalidate_aliases(struct inode *inode)
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index a62df87..f0eb64b 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -362,7 +362,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash,
 
ll_finish_md_op_data(op_data);
 
-   request = (struct ptlrpc_request *)it.it_data;
+   request = (struct ptlrpc_request *)it.it_request;
if (request)
ptlrpc_req_finished(request);
if (rc < 0) {
diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index 92fab63..a188366 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -476,10 +476,9 @@ void ll_ioepoch_open(struct ll_inode_info *lli, __u64 
ioepoch)
 static int ll_och_fill(struct obd_export *md_exp, struct lookup_intent *it,
   struct obd_client_handle *och)
 {
-   struct ptlrpc_request *req = it->it_data;
struct mdt_body *body;
 
-   body = req_capsule_server_get(>rq_pill, _MDT_BODY);
+   body = req_capsule_server_get(>it_request->rq_pill, _MDT_BODY);
och->och_fh = body->handle;
och->och_fid = body->fid1;
och->och_lease_handle.cookie = it->it_lock_handle;
@@ -500,7 +499,6 @@ static int ll_local_open(struct file *file, struct 
lookup_intent *it,
LASSERT(fd);
 
if (och) {
-   struct ptlrpc_request *req = it->it_data;
struct mdt_body *body;
int rc;
 
@@ -508,7 +506,8 @@ static int ll_local_open(struct file *file, struct 
lookup_intent *it,
if (rc != 0)
return rc;
 
-   body = req_capsule_server_get(>rq_pill, _MDT_BODY);
+   body = req_capsule_server_get(>it_request->rq_pill,
+ _MDT_BODY);
ll_ioepoch_open(lli, body->ioepoch);
}
 
@@ -725,7 +724,7 @@ out_openerr:
}
 
if (it && it_disposition(it, DISP_ENQ_OPEN_REF)) {
-   ptlrpc_req_finished(it->it_data);
+   ptlrpc_req_finished(it->it_request);
it_clear_disposition(it, DISP_ENQ_OPEN_REF);
 

[PATCH 26/28] staging/lustre/osc: fix signed one bit field

2016-06-19 Thread Oleg Drokin
From: Dmitry Eremin 

Bit field 'oi_lockless' and 'oi_is_active' has one bit and is signed
which is confusing.

Signed-off-by: Dmitry Eremin 
Reviewed-on: http://review.whamcloud.com/19196
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7258
Reviewed-by: Andreas Dilger 
Reviewed-by: James Simmons 
Reviewed-by: Frank Zago 
Reviewed-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_cl_internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h 
b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
index 437c659..c8c3f1c 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
+++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h
@@ -62,7 +62,7 @@ struct osc_io {
/** super class */
struct cl_io_slice oi_cl;
/** true if this io is lockless. */
-   int oi_lockless;
+   unsigned intoi_lockless;
/** how many LRU pages are reserved for this IO */
int oi_lru_reserved;
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 18/28] staging/lustre/ldlm: const qualify struct lustre_handle * params

2016-06-19 Thread Oleg Drokin
From: "John L. Hammond" 

Add a const qualifier to several struct lustre_handle * parameters in
the LDLM interface.

Signed-off-by: John L. Hammond 
Reviewed-on: http://review.whamcloud.com/17071
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7403
Reviewed-by: Andreas Dilger 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 18 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 14 +++---
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|  2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  4 ++--
 4 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 63085a0..60051a5 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -1073,7 +1073,7 @@ void ldlm_lock2handle(const struct ldlm_lock *lock,
 struct ldlm_lock *__ldlm_handle2lock(const struct lustre_handle *, __u64 
flags);
 void ldlm_cancel_callback(struct ldlm_lock *);
 int ldlm_lock_remove_from_lru(struct ldlm_lock *);
-int ldlm_lock_set_data(struct lustre_handle *, void *);
+int ldlm_lock_set_data(const struct lustre_handle *lockh, void *data);
 
 /**
  * Obtain a lock reference by its handle.
@@ -1162,10 +1162,10 @@ do {\
 struct ldlm_lock *ldlm_lock_get(struct ldlm_lock *lock);
 void ldlm_lock_put(struct ldlm_lock *lock);
 void ldlm_lock2desc(struct ldlm_lock *lock, struct ldlm_lock_desc *desc);
-void ldlm_lock_addref(struct lustre_handle *lockh, __u32 mode);
-int  ldlm_lock_addref_try(struct lustre_handle *lockh, __u32 mode);
-void ldlm_lock_decref(struct lustre_handle *lockh, __u32 mode);
-void ldlm_lock_decref_and_cancel(struct lustre_handle *lockh, __u32 mode);
+void ldlm_lock_addref(const struct lustre_handle *lockh, __u32 mode);
+int  ldlm_lock_addref_try(const struct lustre_handle *lockh, __u32 mode);
+void ldlm_lock_decref(const struct lustre_handle *lockh, __u32 mode);
+void ldlm_lock_decref_and_cancel(const struct lustre_handle *lockh, __u32 
mode);
 void ldlm_lock_fail_match_locked(struct ldlm_lock *lock);
 void ldlm_lock_allow_match(struct ldlm_lock *lock);
 void ldlm_lock_allow_match_locked(struct ldlm_lock *lock);
@@ -1174,10 +1174,10 @@ enum ldlm_mode ldlm_lock_match(struct ldlm_namespace 
*ns, __u64 flags,
   enum ldlm_type type, ldlm_policy_data_t *,
   enum ldlm_mode mode, struct lustre_handle *,
   int unref);
-enum ldlm_mode ldlm_revalidate_lock_handle(struct lustre_handle *lockh,
+enum ldlm_mode ldlm_revalidate_lock_handle(const struct lustre_handle *lockh,
   __u64 *bits);
 void ldlm_lock_cancel(struct ldlm_lock *lock);
-void ldlm_lock_dump_handle(int level, struct lustre_handle *);
+void ldlm_lock_dump_handle(int level, const struct lustre_handle *);
 void ldlm_unlink_lock_skiplist(struct ldlm_lock *req);
 
 /* resource.c */
@@ -1251,9 +1251,9 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct 
ptlrpc_request *req,
  enum ldlm_type type, __u8 with_policy,
  enum ldlm_mode mode,
  __u64 *flags, void *lvb, __u32 lvb_len,
- struct lustre_handle *lockh, int rc);
+ const struct lustre_handle *lockh, int rc);
 int ldlm_cli_update_pool(struct ptlrpc_request *req);
-int ldlm_cli_cancel(struct lustre_handle *lockh,
+int ldlm_cli_cancel(const struct lustre_handle *lockh,
enum ldlm_cancel_flags cancel_flags);
 int ldlm_cli_cancel_unused(struct ldlm_namespace *, const struct ldlm_res_id *,
   enum ldlm_cancel_flags flags, void *opaque);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index b7254eb..a5993f7 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -658,7 +658,7 @@ static void ldlm_add_ast_work_item(struct ldlm_lock *lock,
  * r/w reference type is determined by \a mode
  * Calls ldlm_lock_addref_internal.
  */
-void ldlm_lock_addref(struct lustre_handle *lockh, __u32 mode)
+void ldlm_lock_addref(const struct lustre_handle *lockh, __u32 mode)
 {
struct ldlm_lock *lock;
 
@@ -700,7 +700,7 @@ void ldlm_lock_addref_internal_nolock(struct ldlm_lock 
*lock, __u32 mode)
  *
  * \retval -EAGAIN lock is being canceled.
  */
-int ldlm_lock_addref_try(struct lustre_handle *lockh, __u32 mode)
+int ldlm_lock_addref_try(const struct lustre_handle *lockh, __u32 mode)
 {
struct ldlm_lock *lock;
intresult;
@@ -832,7 +832,7 @@ void 

[PATCH 23/28] staging/lustre/llite: Restore proper opencache operations

2016-06-19 Thread Oleg Drokin
From: Oleg Drokin 

Mark dentries that came to us via NFS in a special way so that
we can tell them apart during open and activate open cache
(we really don't want to do open/close RPC for every NFS IO).

This became needed since dentry revlidate no longer reimplements
any RPCs for lookup, and as such if a dentry is valid,
ll_revalidate_dentry returns 1 and ll_lookup_it() is never visited
during opens, we get straght into ll_file_open() without a valid
intent/RPC. This used to be only true for NFS, so opencache was
engaged needlessly, and it carries a cost of it's own if there is
in fact no repetitive file opening-closing going on

Signed-off-by: Oleg Drokin 
Reviewed-on: http://review.whamcloud.com/20354
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8019
Reviewed-by: Andreas Dilger 
Reviewed-by: Li Xi 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c   | 14 +-
 drivers/staging/lustre/lustre/llite/llite_internal.h |  1 +
 drivers/staging/lustre/lustre/llite/llite_nfs.c  | 18 ++
 3 files changed, 32 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index a188366..6a5e8c7 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -411,7 +411,19 @@ static int ll_intent_file_open(struct dentry *dentry, void 
*lmm,
 * parameters. No need for the open lock
 */
if (!lmm && lmmsize == 0) {
-   itp->it_flags |= MDS_OPEN_LOCK;
+   struct ll_dentry_data *ldd = ll_d2d(dentry);
+   /*
+* If we came via ll_iget_for_nfs, then we need to request
+* struct ll_dentry_data *ldd = ll_d2d(file->f_dentry);
+*
+* NB: when ldd is NULL, it must have come via normal
+* lookup path only, since ll_iget_for_nfs always calls
+* ll_d_init().
+*/
+   if (ldd && ldd->lld_nfs_dentry) {
+   ldd->lld_nfs_dentry = 0;
+   itp->it_flags |= MDS_OPEN_LOCK;
+   }
if (itp->it_flags & FMODE_WRITE)
opc = LUSTRE_OPC_CREATE;
}
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 3692102..1d4e91e 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -64,6 +64,7 @@ struct ll_dentry_data {
struct lookup_intent*lld_it;
unsigned intlld_sa_generation;
unsigned intlld_invalid:1;
+   unsigned intlld_nfs_dentry:1;
struct rcu_head lld_rcu_head;
 };
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c 
b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index d7878e5..65972c8 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -168,6 +168,24 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid 
*fid, struct lu_fid *paren
 
/* N.B. d_obtain_alias() drops inode ref on error */
result = d_obtain_alias(inode);
+   if (!IS_ERR(result)) {
+   int rc;
+
+   rc = ll_d_init(result);
+   if (rc < 0) {
+   dput(result);
+   result = ERR_PTR(rc);
+   } else {
+   struct ll_dentry_data *ldd = ll_d2d(result);
+
+   /*
+* Need to signal to the ll_intent_file_open that
+* we came from NFS and so opencache needs to be
+* enabled for this one
+*/
+   ldd->lld_nfs_dentry = 1;
+   }
+   }
 
return result;
 }
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 28/28] staging/lustre/osc: glimpse lock should match only with granted locks

2016-06-19 Thread Oleg Drokin
From: Andriy Skulysh 

A deadlock is possible during ccc_prep_size()->ldlm_lock_match() vs
cl_io_lock() which is waiting for a matched lock and conflicts with
already taken lock before ccc_prep_size().

It is better to send an additional lock request to avoid deadlock.

Seagate-bug-id: MRP-3312
Signed-off-by: Andriy Skulysh 
Reviewed-on: http://review.whamcloud.com/18738
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7829
Reviewed-by: Jinshan Xiong 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_request.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 9334349..536b868 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -2246,7 +2246,7 @@ int osc_enqueue_base(struct obd_export *exp, struct 
ldlm_res_id *res_id,
struct lustre_handle lockh = { 0 };
struct ptlrpc_request *req = NULL;
int intent = *flags & LDLM_FL_HAS_INTENT;
-   __u64 match_lvb = agl ? 0 : LDLM_FL_LVB_READY;
+   __u64 match_flags = *flags;
enum ldlm_mode mode;
int rc;
 
@@ -2281,7 +2281,11 @@ int osc_enqueue_base(struct obd_export *exp, struct 
ldlm_res_id *res_id,
mode = einfo->ei_mode;
if (einfo->ei_mode == LCK_PR)
mode |= LCK_PW;
-   mode = ldlm_lock_match(obd->obd_namespace, *flags | match_lvb, res_id,
+   if (agl == 0)
+   match_flags |= LDLM_FL_LVB_READY;
+   if (intent != 0)
+   match_flags |= LDLM_FL_BLOCK_GRANTED;
+   mode = ldlm_lock_match(obd->obd_namespace, match_flags, res_id,
   einfo->ei_type, policy, mode, , 0);
if (mode) {
struct ldlm_lock *matched;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 27/28] staging/lustre: Add documentation for unstable_stats in sysfs

2016-06-19 Thread Oleg Drokin
commit ac5b14810952 ("staging: lustre: osc: Track and limit
"unstable" pages") added a new sysfs variable, but corresponding bit of
documentation was not forgotten.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/sysfs-fs-lustre | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/staging/lustre/sysfs-fs-lustre 
b/drivers/staging/lustre/sysfs-fs-lustre
index 873e2cf..20206ba 100644
--- a/drivers/staging/lustre/sysfs-fs-lustre
+++ b/drivers/staging/lustre/sysfs-fs-lustre
@@ -294,6 +294,14 @@ Description:
Controls extended attributes client-side cache.
1 to enable, 0 to disable.
 
+What:  /sys/fs/lustre/llite/-/unstable_stats
+Date:  Apr 2016
+Contact:   "Oleg Drokin" 
+Description:
+   Shows number of pages that were sent and acknowledged by
+   server but were not yet committed and therefore still
+   pinned in client memory even though no longer dirty.
+
 What:  /sys/fs/lustre/ldlm/cancel_unused_locks_before_replay
 Date:  May 2015
 Contact:   "Oleg Drokin" 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 22/28] staging/lustre/llite: don't panic when fid is insane

2016-06-19 Thread Oleg Drokin
From: Sergey Cheremencev 

LASSERT should never be done on data that is
received to over the network. Return EINVAL
when server returns invalid fid despite of
it_status == 0.

Signed-off-by: Sergey Cheremencev 
Seagate-bug-id: MRP-3073
Reviewed-on: http://review.whamcloud.com/17985
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7422
Reviewed-by: John L. Hammond 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_lib.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 539fdd1..118e41d 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -1971,7 +1971,13 @@ int ll_prep_inode(struct inode **inode, struct 
ptlrpc_request *req,
 * At this point server returns to client's same fid as client
 * generated for creating. So using ->fid1 is okay here.
 */
-   LASSERT(fid_is_sane(>fid1));
+   if (!fid_is_sane(>fid1)) {
+   CERROR("%s: Fid is insane " DFID "\n",
+  ll_get_fsname(sb, NULL, 0),
+  PFID(>fid1));
+   rc = -EINVAL;
+   goto out;
+   }
 
*inode = ll_iget(sb, cl_fid_build_ino(>fid1,
 sbi->ll_flags & LL_SBI_32BIT_API),
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 25/28] staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino

2016-06-19 Thread Oleg Drokin
From: akam kumar bharathi 

req_capsule_server_get() through  __req_capsule_get in ll_dir_ioctl()
returns a pointer to a PTLRPC request or reply buffer, which is assigned
to struct mdt_body.

If the command is IOC_MDS_GETFILEINFO then the inode "st.st_ino" should
be assigned from one extracted from mdt_body through cl_fid_build_ino().

Signed-off-by: John Hammond 
Signed-off-by: akam kumar bharathi 
Reviewed-on: http://review.whamcloud.com/17618
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5954
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dir.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index f0eb64b..7e7425d 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -1528,7 +1528,9 @@ skip_lmm:
st.st_atime   = body->atime;
st.st_mtime   = body->mtime;
st.st_ctime   = body->ctime;
-   st.st_ino = inode->i_ino;
+   st.st_ino = cl_fid_build_ino(>fid1,
+sbi->ll_flags &
+LL_SBI_32BIT_API);
 
lmdp = (struct lov_user_mds_data __user *)arg;
if (copy_to_user(>lmd_st, , sizeof(st))) {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/28] staging/lustre: LDLM_DEBUG() shouldn't be passed \n

2016-06-19 Thread Oleg Drokin
From: Alex Zhuravlev 

as it adds own \n, so any extra \n break log format.

Signed-off-by: Alex Zhuravlev 
Reviewed-on: http://review.whamcloud.com/17494
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7521
Reviewed-by: James Simmons 
Reviewed-by: John L. Hammond 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c| 3 ++-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 2 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 +-
 drivers/staging/lustre/lustre/lov/lov_object.c | 4 ++--
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  | 2 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c  | 4 ++--
 drivers/staging/lustre/lustre/osc/osc_lock.c   | 2 +-
 8 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
index 1ecdfa2..b7254eb 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
@@ -1440,7 +1440,7 @@ int ldlm_fill_lvb(struct ldlm_lock *lock, struct 
req_capsule *pill,
memcpy(data, lvb, size);
break;
default:
-   LDLM_ERROR(lock, "Unknown LVB type: %d\n", lock->l_lvb_type);
+   LDLM_ERROR(lock, "Unknown LVB type: %d", lock->l_lvb_type);
dump_stack();
return -EINVAL;
}
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index 3eab059..8294703 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -637,7 +637,8 @@ static int ldlm_callback_handler(struct ptlrpc_request *req)
 */
if ((ldlm_is_canceling(lock) && ldlm_is_bl_done(lock)) ||
ldlm_is_failed(lock)) {
-   LDLM_DEBUG(lock, "callback on lock %#llx - lock 
disappeared\n",
+   LDLM_DEBUG(lock,
+  "callback on lock %#llx - lock disappeared",
   dlm_req->lock_handle[0].cookie);
unlock_res_and_lock(lock);
LDLM_LOCK_RELEASE(lock);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 471ab08..d3a376e 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -711,7 +711,7 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct 
ptlrpc_request **reqp,
 
lock->l_req_extent = policy->l_extent;
}
-   LDLM_DEBUG(lock, "client-side enqueue START, flags %llx\n",
+   LDLM_DEBUG(lock, "client-side enqueue START, flags %llx",
   *flags);
}
 
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index f7c95b7..51a28d9 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -1275,7 +1275,7 @@ void ldlm_resource_add_lock(struct ldlm_resource *res, 
struct list_head *head,
 {
check_res_locked(res);
 
-   LDLM_DEBUG(lock, "About to add this lock:\n");
+   LDLM_DEBUG(lock, "About to add this lock:");
 
if (ldlm_is_destroyed(lock)) {
CDEBUG(D_OTHER, "Lock destroyed, not adding to resource\n");
diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c 
b/drivers/staging/lustre/lustre/lov/lov_object.c
index ec55b88..f9621b0 100644
--- a/drivers/staging/lustre/lustre/lov/lov_object.c
+++ b/drivers/staging/lustre/lustre/lov/lov_object.c
@@ -181,8 +181,8 @@ static int lov_init_sub(const struct lu_env *env, struct 
lov_object *lov,
}
 
LU_OBJECT_DEBUG(mask, env, >co_lu,
-   "stripe %d is already owned.\n", idx);
-   LU_OBJECT_DEBUG(mask, env, old_obj, "owned.\n");
+   "stripe %d is already owned.", idx);
+   LU_OBJECT_DEBUG(mask, env, old_obj, "owned.");
LU_OBJECT_HEADER(mask, env, lov2lu(lov), "try to own.\n");
cl_object_put(env, stripe);
}
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c 
b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index b395420..19b549c 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -711,7 +711,7 @@ static int mdc_finish_enqueue(struct obd_export *exp,
if (lock && ldlm_has_layout(lock) && lvb_data) {
void *lmm;
 
-   

[PATCH 16/28] staging/lustre: Inline Lustre intent disposition functions

2016-06-19 Thread Oleg Drokin
They are just one-liners, so no point in having them exported
and called through a different module.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_intent.h | 15 +++
 drivers/staging/lustre/lustre/include/lustre_mdc.h|  3 ---
 drivers/staging/lustre/lustre/mdc/mdc_locks.c | 18 --
 3 files changed, 15 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_intent.h 
b/drivers/staging/lustre/lustre/include/lustre_intent.h
index 41c03d7..3aed810 100644
--- a/drivers/staging/lustre/lustre/include/lustre_intent.h
+++ b/drivers/staging/lustre/lustre/include/lustre_intent.h
@@ -50,4 +50,19 @@ struct lookup_intent {
unsigned intit_lock_set:1;
 };
 
+static inline int it_disposition(struct lookup_intent *it, int flag)
+{
+   return it->it_disposition & flag;
+}
+
+static inline void it_set_disposition(struct lookup_intent *it, int flag)
+{
+   it->it_disposition |= flag;
+}
+
+static inline void it_clear_disposition(struct lookup_intent *it, int flag)
+{
+   it->it_disposition &= ~flag;
+}
+
 #endif
diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h 
b/drivers/staging/lustre/lustre/include/lustre_mdc.h
index 0ef4226..fa62b95 100644
--- a/drivers/staging/lustre/lustre/include/lustre_mdc.h
+++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h
@@ -185,9 +185,6 @@ struct mdc_cache_waiter {
 };
 
 /* mdc/mdc_locks.c */
-int it_disposition(struct lookup_intent *it, int flag);
-void it_clear_disposition(struct lookup_intent *it, int flag);
-void it_set_disposition(struct lookup_intent *it, int flag);
 int it_open_error(int phase, struct lookup_intent *it);
 
 static inline bool cl_is_lov_delay_create(unsigned int flags)
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c 
b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 5da2a1e..c43b3a2 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -50,24 +50,6 @@ struct mdc_getattr_args {
struct ldlm_enqueue_info*ga_einfo;
 };
 
-int it_disposition(struct lookup_intent *it, int flag)
-{
-   return it->it_disposition & flag;
-}
-EXPORT_SYMBOL(it_disposition);
-
-void it_set_disposition(struct lookup_intent *it, int flag)
-{
-   it->it_disposition |= flag;
-}
-EXPORT_SYMBOL(it_set_disposition);
-
-void it_clear_disposition(struct lookup_intent *it, int flag)
-{
-   it->it_disposition &= ~flag;
-}
-EXPORT_SYMBOL(it_clear_disposition);
-
 int it_open_error(int phase, struct lookup_intent *it)
 {
if (it_disposition(it, DISP_OPEN_LEASE)) {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/28] staging/lustre/llite: take trunc_sem only at vvp layer

2016-06-19 Thread Oleg Drokin
From: Patrick Farrell 

The lli_trunc_sem is taken in 'read' mode in both
ll_page_mkwrite and vvp_io_fault_start. This can lead to a
deadlock with another thread which asks for the semaphore
in write mode between thse two read calls.

Since all users of lli_trunc_sem are in the vvp layer, we
can satisfy the requirement to exclude truncate by taking
the semaphore only in vvp_io_fault_start.

Signed-off-by: Patrick Farrell 
Reviewed-on: http://review.whamcloud.com/19315
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7981
Reviewed-by: Jinshan Xiong 
Reviewed-by: Andriy Skulysh 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/llite_mmap.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c 
b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index fb1c3b6..66ee5db 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -196,18 +196,11 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, 
struct page *vmpage,
 
set = cfs_block_sigsinv(sigmask(SIGKILL) | sigmask(SIGTERM));
 
-   /* we grab lli_trunc_sem to exclude truncate case.
-* Otherwise, we could add dirty pages into osc cache
-* while truncate is on-going.
-*/
inode = vvp_object_inode(io->ci_obj);
lli = ll_i2info(inode);
-   down_read(>lli_trunc_sem);
 
result = cl_io_loop(env, io);
 
-   up_read(>lli_trunc_sem);
-
cfs_restore_sigs(set);
 
if (result == 0) {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/28] staging/lustre: Add newline to LU_OBJECT_DEBUG() message

2016-06-19 Thread Oleg Drokin
From: Bob Glossman 

LU_OBJECT_DEBUG expects non \n terminated message from the caller,
so it should add it's own to keep debug logger happy.

Signed-off-by: Bob Glossman 
Reviewed-on: http://review.whamcloud.com/19960
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8094
Reviewed-by: Andreas Dilger 
Reviewed-by: Alex Zhuravlev 
Reviewed-by: John L. Hammond 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lu_object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h 
b/drivers/staging/lustre/lustre/include/lu_object.h
index c6281e6..6e25c1b 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -779,7 +779,7 @@ do {
  \
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) {\
LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL);
\
lu_object_print(env, , lu_cdebug_printer, object);\
-   CDEBUG(mask, format, ## __VA_ARGS__);   \
+   CDEBUG(mask, format "\n", ## __VA_ARGS__);  \
}\
 } while (0)
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 09/28] staging/lustre/ptlrpc: Early Reply vs Reply MDunlink

2016-06-19 Thread Oleg Drokin
From: Vitaly Fertman 

A race between unregister_reply & early reply.
When buffers are busy for the early transfer, they cannon be unlinked
by unregister_reply, so the RPC gets into UNREGISTERING state. The
coming reply_in_callback for the early RPC already has unlinked flag
set due to previous mdunlink attempt, but we handle it properly only
for UNILNK event, whereas this is PUT in this case.

Signed-off-by: Vitaly Fertman 
Seagate-bug-id: MRP-3323
Reviewed-by: Alexey Leonidovich Lyashkov 
Reviewed-by: Andriy Skulysh 
Tested-by: Parinay Vijayprakash Kondekar 
Reviewed-on: http://review.whamcloud.com/18934
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7434
Reviewed-by: Chris Horn 
Reviewed-by: Andreas Dilger 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c 
b/drivers/staging/lustre/lustre/ptlrpc/events.c
index a243342..b1ce725 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/events.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/events.c
@@ -137,7 +137,8 @@ void reply_in_callback(lnet_event_t *ev)
 
req->rq_early_count++; /* number received, client side */
 
-   if (req->rq_replied)   /* already got the real reply */
+   /* already got the real reply or buffers are already unlinked */
+   if (req->rq_replied || req->rq_reply_unlinked == 1)
goto out_wake;
 
req->rq_early = 1;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 06/28] staging/lustre/osc: Fix reverted condition in osc_lock_weight

2016-06-19 Thread Oleg Drokin
When importing clio simplification patch, the check for
object got reversed by mistake when converting from
if (obj == NULL) it somehow became if (obj) which is obviously wrong,
and so when it does hit, a crash was happening as result.

Fix the condition and all if fine now.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c 
b/drivers/staging/lustre/lustre/osc/osc_lock.c
index d856775..5455d9d 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -699,7 +699,7 @@ unsigned long osc_ldlm_weigh_ast(struct ldlm_lock *dlmlock)
 
LASSERT(dlmlock->l_resource->lr_type == LDLM_EXTENT);
obj = dlmlock->l_ast_data;
-   if (obj) {
+   if (!obj) {
weight = 1;
goto out;
}
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/28] staging/lustre/ptlrpc: missing wakeup for ptlrpc_check_set

2016-06-19 Thread Oleg Drokin
From: Liang Zhen 

This patch changes a few things:

- There is no guarantee that request_out_callback will happen
  before reply_in_callback, if a request got reply and unlinked
  reply buffer before request_out_callback is called, then the
  thread waiting on ptlrpc_request_set will miss wakeup event.

  This may seriously impact performance of some IO workloads or
  result in RPC timeout

- To make code more easier to understand, this patch changes
  action-bits "rq_req_unlink" and "rq_reply_unlink" to
  status-bits "rq_req_unlinked" and "rq_reply_unlinked"

Signed-off-by: Liang Zhen 
Reviewed-on: http://review.whamcloud.com/12158
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5696
Reviewed-by: Johann Lombardi 
Reviewed-by: Li Wei 
Reviewed-by: Mike Pershin 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_net.h | 27 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 12 --
 drivers/staging/lustre/lustre/ptlrpc/events.c  | 22 +++---
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  | 14 +--
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  9 
 5 files changed, 51 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index 5968c3c..523d082 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -1428,7 +1428,7 @@ struct ptlrpc_request {
 * rq_list
 */
spinlock_t rq_lock;
-   /** client-side flags are serialized by rq_lock */
+   /** client-side flags are serialized by rq_lock @{ */
unsigned int rq_intr:1, rq_replied:1, rq_err:1,
rq_timedout:1, rq_resend:1, rq_restart:1,
/**
@@ -1444,18 +1444,15 @@ struct ptlrpc_request {
rq_no_resend:1, rq_waiting:1, rq_receiving_reply:1,
rq_no_delay:1, rq_net_err:1, rq_wait_ctx:1,
rq_early:1,
-   rq_req_unlink:1, rq_reply_unlink:1,
+   rq_req_unlinked:1,  /* unlinked request buffer from lnet */
+   rq_reply_unlinked:1,/* unlinked reply buffer from lnet */
rq_memalloc:1,  /* req originated from "kswapd" */
-   /* server-side flags */
-   rq_packed_final:1,  /* packed final reply */
-   rq_hp:1,/* high priority RPC */
-   rq_at_linked:1, /* link into service's srv_at_array */
-   rq_reply_truncate:1,
rq_committed:1,
-   /* whether the "rq_set" is a valid one */
+   rq_reply_truncated:1,
+   /** whether the "rq_set" is a valid one */
rq_invalid_rqset:1,
rq_generation_set:1,
-   /* do not resend request on -EINPROGRESS */
+   /** do not resend request on -EINPROGRESS */
rq_no_retry_einprogress:1,
/* allow the req to be sent if the import is in recovery
 * status
@@ -1463,6 +1460,14 @@ struct ptlrpc_request {
rq_allow_replay:1,
/* bulk request, sent to server, but uncommitted */
rq_unstable:1;
+   /** @} */
+
+   /** server-side flags @{ */
+   unsigned int
+   rq_hp:1,/**< high priority RPC */
+   rq_at_linked:1, /**< link into service's srv_at_array */
+   rq_packed_final:1;  /**< packed final reply */
+   /** @} */
 
/** one of RQ_PHASE_* */
enum rq_phase   rq_phase;
@@ -2785,8 +2790,8 @@ ptlrpc_client_recv_or_unlink(struct ptlrpc_request *req)
spin_unlock(>rq_lock);
return 1;
}
-   rc = req->rq_receiving_reply;
-   rc = rc || req->rq_req_unlink || req->rq_reply_unlink;
+   rc = !req->rq_req_unlinked || !req->rq_reply_unlinked ||
+req->rq_receiving_reply;
spin_unlock(>rq_lock);
return rc;
 }
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 9abd469..ae1cef3 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -1148,9 +1148,9 @@ static int after_reply(struct ptlrpc_request *req)
 
LASSERT(obd);
/* repbuf must be unlinked */
-   LASSERT(!req->rq_receiving_reply && !req->rq_reply_unlink);
+   LASSERT(!req->rq_receiving_reply && req->rq_reply_unlinked);
 
-   if (req->rq_reply_truncate) {
+   if (req->rq_reply_truncated) {
if (ptlrpc_no_resend(req)) {
DEBUG_REQ(D_ERROR, req, "reply buffer overflow, 
expected: %d, actual size: %d",
 

[PATCH 03/28] staging/lustre/llite: Get rid of ll_lock_dcache/ll_unlock_dcache

2016-06-19 Thread Oleg Drokin
These are just doing spin_lock/unlock on inode's i_lock,
so just do the spinlock directly to make the code more clear

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/dcache.c |  4 ++--
 drivers/staging/lustre/lustre/llite/llite_internal.h | 10 --
 drivers/staging/lustre/lustre/llite/namei.c  |  8 
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 9d13d5e..f002b3a 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -249,7 +249,7 @@ void ll_invalidate_aliases(struct inode *inode)
CDEBUG(D_INODE, "marking dentries for ino "DFID"(%p) invalid\n",
   PFID(ll_inode2fid(inode)), inode);
 
-   ll_lock_dcache(inode);
+   spin_lock(>i_lock);
hlist_for_each_entry(dentry, >i_dentry, d_u.d_alias) {
CDEBUG(D_DENTRY, "dentry in drop %pd (%p) parent %p inode %p 
flags %d\n",
   dentry, dentry, dentry->d_parent,
@@ -257,7 +257,7 @@ void ll_invalidate_aliases(struct inode *inode)
 
d_lustre_invalidate(dentry, 0);
}
-   ll_unlock_dcache(inode);
+   spin_unlock(>i_lock);
 }
 
 int ll_revalidate_it_finish(struct ptlrpc_request *request,
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 74cd241..098155f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -1313,16 +1313,6 @@ static inline void ll_set_lock_data(struct obd_export 
*exp, struct inode *inode,
*bits = it->d.lustre.it_lock_bits;
 }
 
-static inline void ll_lock_dcache(struct inode *inode)
-{
-   spin_lock(>i_lock);
-}
-
-static inline void ll_unlock_dcache(struct inode *inode)
-{
-   spin_unlock(>i_lock);
-}
-
 static inline int d_lustre_invalid(const struct dentry *dentry)
 {
struct ll_dentry_data *lld = ll_d2d(dentry);
diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 6414d52..e4df510 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -140,7 +140,7 @@ static void ll_invalidate_negative_children(struct inode 
*dir)
 {
struct dentry *dentry, *tmp_subdir;
 
-   ll_lock_dcache(dir);
+   spin_lock(>i_lock);
hlist_for_each_entry(dentry, >i_dentry, d_u.d_alias) {
spin_lock(>d_lock);
if (!list_empty(>d_subdirs)) {
@@ -155,7 +155,7 @@ static void ll_invalidate_negative_children(struct inode 
*dir)
}
spin_unlock(>d_lock);
}
-   ll_unlock_dcache(dir);
+   spin_unlock(>i_lock);
 }
 
 int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
@@ -317,7 +317,7 @@ static struct dentry *ll_find_alias(struct inode *inode, 
struct dentry *dentry)
discon_alias = NULL;
invalid_alias = NULL;
 
-   ll_lock_dcache(inode);
+   spin_lock(>i_lock);
hlist_for_each_entry(alias, >i_dentry, d_u.d_alias) {
LASSERT(alias != dentry);
 
@@ -342,7 +342,7 @@ static struct dentry *ll_find_alias(struct inode *inode, 
struct dentry *dentry)
dget_dlock(alias);
spin_unlock(>d_lock);
}
-   ll_unlock_dcache(inode);
+   spin_unlock(>i_lock);
 
return alias;
 }
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/28] staging/lustre/osc: osc_lock_weight endless loop fix

2016-06-19 Thread Oleg Drokin
From: Jinshan Xiong 

With huge number of pages to scan by osc_lock_weight() it is likely
CLP_GANG_RESCHED is returned from osc_page_gang_lookup() and the scan
will be repeated again from the start. To be sure that the scan is
progressing across those restarts, next scan should be started from
the last scanned page index plus one.

Xyratex-bug-id: MRP-2145
Signed-off-by: Alexander Zarochentsev 
Signed-off-by: Jinshan Xiong 
Reviewed-on: http://review.whamcloud.com/12362
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5781
Reviewed-by: Bobi Jam 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/osc/osc_lock.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c 
b/drivers/staging/lustre/lustre/osc/osc_lock.c
index 42def38..d856775 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -634,11 +634,10 @@ static int weigh_cb(const struct lu_env *env, struct 
cl_io *io,
 
if (cl_page_is_vmlocked(env, page) ||
PageDirty(page->cp_vmpage) || PageWriteback(page->cp_vmpage)
-  ) {
-   (*(unsigned long *)cbdata)++;
+  )
return CLP_GANG_ABORT;
-   }
 
+   *(pgoff_t *)cbdata = osc_index(ops) + 1;
return CLP_GANG_OKAY;
 }
 
@@ -648,7 +647,7 @@ static unsigned long osc_lock_weight(const struct lu_env 
*env,
 {
struct cl_io *io = _env_info(env)->oti_io;
struct cl_object *obj = cl_object_top(>oo_cl);
-   unsigned long npages = 0;
+   pgoff_t page_index;
int result;
 
io->ci_obj = obj;
@@ -657,11 +656,12 @@ static unsigned long osc_lock_weight(const struct lu_env 
*env,
if (result != 0)
return result;
 
+   page_index = cl_index(obj, extent->start);
do {
result = osc_page_gang_lookup(env, io, oscobj,
- cl_index(obj, extent->start),
+ page_index,
  cl_index(obj, extent->end),
- weigh_cb, (void *));
+ weigh_cb, (void *)_index);
if (result == CLP_GANG_ABORT)
break;
if (result == CLP_GANG_RESCHED)
@@ -669,7 +669,7 @@ static unsigned long osc_lock_weight(const struct lu_env 
*env,
} while (result != CLP_GANG_OKAY);
cl_io_fini(env, io);
 
-   return npages;
+   return result == CLP_GANG_ABORT ? 1 : 0;
 }
 
 /**
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/28] staging/lustre/ptlrpc: reorganize ptlrpc_request

2016-06-19 Thread Oleg Drokin
From: Liang Zhen 

ptlrpc_request has some structure members are only for client side,
and some others are only for server side, this patch moved these
members to different structure then putting into an union.

By doing this, size of ptlrpc_request is decreased about 300 bytes,
besides saving memory, it also can reduce memory footprint while
processing.

Signed-off-by: Liang Zhen 
Reviewed-on: http://review.whamcloud.com/8806
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-181
Reviewed-by: Andreas Dilger 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_net.h | 341 -
 drivers/staging/lustre/lustre/ptlrpc/client.c  |  49 +--
 drivers/staging/lustre/lustre/ptlrpc/events.c  |   5 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |   2 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  34 ++
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c |   9 +-
 7 files changed, 255 insertions(+), 189 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h 
b/drivers/staging/lustre/lustre/include/lustre_net.h
index dba4d1d..5968c3c 100644
--- a/drivers/staging/lustre/lustre/include/lustre_net.h
+++ b/drivers/staging/lustre/lustre/include/lustre_net.h
@@ -266,6 +266,11 @@
 /* Macro to hide a typecast. */
 #define ptlrpc_req_async_args(req) ((void *)>rq_async_args)
 
+struct ptlrpc_replay_async_args {
+   int praa_old_state;
+   int praa_old_status;
+};
+
 /**
  * Structure to single define portal connection.
  */
@@ -1243,22 +1248,100 @@ struct ptlrpc_hpreq_ops {
void (*hpreq_fini)(struct ptlrpc_request *);
 };
 
-/**
- * Represents remote procedure call.
- *
- * This is a staple structure used by everybody wanting to send a request
- * in Lustre.
- */
-struct ptlrpc_request {
-   /* Request type: one of PTL_RPC_MSG_* */
-   int rq_type;
-   /** Result of request processing */
-   int rq_status;
+struct ptlrpc_cli_req {
+   /** For bulk requests on client only: bulk descriptor */
+   struct ptlrpc_bulk_desc *cr_bulk;
+   /** optional time limit for send attempts */
+   long cr_delay_limit;
+   /** time request was first queued */
+   time_t   cr_queued_time;
+   /** request sent timeval */
+   struct timespec64cr_sent_tv;
+   /** time for request really sent out */
+   time_t   cr_sent_out;
+   /** when req reply unlink must finish. */
+   time_t   cr_reply_deadline;
+   /** when req bulk unlink must finish. */
+   time_t   cr_bulk_deadline;
+   /** Portal to which this request would be sent */
+   shortcr_req_ptl;
+   /** Portal where to wait for reply and where reply would be sent */
+   shortcr_rep_ptl;
+   /** request resending number */
+   unsigned int cr_resend_nr;
+   /** What was import generation when this request was sent */
+   int  cr_imp_gen;
+   enum lustre_imp_statecr_send_state;
+   /** Per-request waitq introduced by bug 21938 for recovery waiting */
+   wait_queue_head_tcr_set_waitq;
+   /** Link item for request set lists */
+   struct list_head cr_set_chain;
+   /** link to waited ctx */
+   struct list_head cr_ctx_chain;
+
+   /** client's half ctx */
+   struct ptlrpc_cli_ctx   *cr_cli_ctx;
+   /** Link back to the request set */
+   struct ptlrpc_request_set   *cr_set;
+   /** outgoing request MD handle */
+   lnet_handle_md_t cr_req_md_h;
+   /** request-out callback parameter */
+   struct ptlrpc_cb_id  cr_req_cbid;
+   /** incoming reply MD handle */
+   lnet_handle_md_t cr_reply_md_h;
+   wait_queue_head_tcr_reply_waitq;
+   /** reply callback parameter */
+   struct ptlrpc_cb_id  cr_reply_cbid;
+   /** Async completion handler, called when reply is received */
+   ptlrpc_interpterer_t cr_reply_interp;
+   /** Async completion context */
+   union ptlrpc_async_args  cr_async_args;
+   /** Opaq data for replay and commit callbacks. */
+   void*cr_cb_data;
/**
-* Linkage item through which this request is included into
-* sending/delayed lists on client and into rqbd list on server
+* Commit callback, called when request is committed and about to be
+* freed.
 */
-   struct 

[PATCH 04/28] staging/lustre/llite: lock i_lock before __d_drop()

2016-06-19 Thread Oleg Drokin
From: Bruno Faccini 

There has been several Lustre Client crashes reported by sites
running with Lustre versions 2.1/2.5, all showing the same
dentry->d_hash->next corrupted pointer cause.

This patch fixes a regression that has been introduced since a
long time by commit :
(LU-506 kernel: FC15 - support dcache scalability changes.)

where i_lock protection usage has been removed and
that is likely to cause racy condition during dentry [un]hashing
and to be the root cause of these crashes.

Signed-off-by: Bruno Faccini 
Reviewed-on: http://review.whamcloud.com/19287
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7973
Reviewed-by: Lai Siyao 
Reviewed-by: Yang Sheng 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index b0c4548..5436a54 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2975,8 +2975,11 @@ static int __ll_inode_revalidate(struct dentry *dentry, 
__u64 ibits)
 * here to preserve get_cwd functionality on 2.6.
 * Bug 10503
 */
-   if (!d_inode(dentry)->i_nlink)
+   if (!d_inode(dentry)->i_nlink) {
+   spin_lock(>i_lock);
d_lustre_invalidate(dentry, 0);
+   spin_unlock(>i_lock);
+   }
 
ll_lookup_finish_locks(, inode);
} else if (!ll_have_md_lock(d_inode(dentry), , LCK_MINMODE)) {
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/28] Lustre fixes

2016-06-19 Thread Oleg Drokin
These patches represent another round of Lustre fixes
and also a few cleanups that some of the fixes were
building up upon.

Please consider.

Alex Zhuravlev (1):
  staging/lustre: LDLM_DEBUG() shouldn't be passed \n

Andriy Skulysh (1):
  staging/lustre/osc: glimpse lock should match only with granted locks

Ben Evans (1):
  staging/lustre/ptlrpc: Remove __ptlrpc_request_bufs_pack

Bob Glossman (1):
  staging/lustre: Add newline to LU_OBJECT_DEBUG() message

Bruno Faccini (1):
  staging/lustre/llite: lock i_lock before __d_drop()

Dmitry Eremin (1):
  staging/lustre/osc: fix signed one bit field

Doug Oucharek (1):
  staging/lustre/o2ib: Don't access NULL NI on failure path

Emoly Liu (1):
  staging/lustre/llite: allocate and free client cache asynchronously

Jinshan Xiong (1):
  staging/lustre/osc: osc_lock_weight endless loop fix

John L. Hammond (4):
  staging/lustre/llite: correct request handling after ll_lookup_it()
  staging/lustre/llite: flatten struct lookup_intent
  staging/lustre/llite: change it_data to it_request
  staging/lustre/ldlm: const qualify struct lustre_handle * params

Liang Zhen (2):
  staging/lustre/ptlrpc: reorganize ptlrpc_request
  staging/lustre/ptlrpc: missing wakeup for ptlrpc_check_set

Niu Yawei (1):
  staging/lustre/mdc: Zero atime in close RPC

Oleg Drokin (6):
  staging/lustre/llite: Get rid of ll_lock_dcache/ll_unlock_dcache
  staging/lustre/osc: Fix reverted condition in osc_lock_weight
  staging/lustre: Inline Lustre intent disposition functions
  staging/lustre/llite: Restore proper opencache operations
  staging/lustre/llite: ll_revalidate_dentry update
  staging/lustre: Add documentation for unstable_stats in sysfs

Patrick Farrell (1):
  staging/lustre/llite: take trunc_sem only at vvp layer

Sergey Cheremencev (1):
  staging/lustre/llite: don't panic when fid is insane

Vitaly Fertman (2):
  staging/lustre/ptlrpc: Early Reply vs Reply MDunlink
  staging/lustre/ptlrpc: lost bulk leads to a hang

Yang Sheng (1):
  staging/lustre/llite: ensure obd is effective in onu_upcall

akam kumar bharathi (1):
  staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino

 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |   8 +-
 drivers/staging/lustre/lustre/include/cl_object.h  |  10 +-
 drivers/staging/lustre/lustre/include/lu_object.h  |   2 +-
 drivers/staging/lustre/lustre/include/lustre_dlm.h |  18 +-
 .../staging/lustre/lustre/include/lustre_intent.h  |  30 +-
 drivers/staging/lustre/lustre/include/lustre_mdc.h |   3 -
 drivers/staging/lustre/lustre/include/lustre_net.h | 414 -
 drivers/staging/lustre/lustre/include/obd.h|   2 +-
 .../staging/lustre/lustre/include/obd_support.h|   3 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |  16 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c|   5 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |   6 +-
 drivers/staging/lustre/lustre/ldlm/ldlm_resource.c |   2 +-
 drivers/staging/lustre/lustre/llite/dcache.c   |  41 +-
 drivers/staging/lustre/lustre/llite/dir.c  |   8 +-
 drivers/staging/lustre/lustre/llite/file.c |  66 ++--
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |   8 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  27 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c|  47 +--
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |   7 -
 drivers/staging/lustre/lustre/llite/llite_nfs.c|  18 +
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |   6 +-
 drivers/staging/lustre/lustre/llite/namei.c|  25 +-
 drivers/staging/lustre/lustre/llite/statahead.c|  10 +-
 drivers/staging/lustre/lustre/llite/xattr_cache.c  |  16 +-
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |  26 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|   8 +-
 drivers/staging/lustre/lustre/lov/lov_obd.c|   7 +
 drivers/staging/lustre/lustre/lov/lov_object.c |   4 +-
 drivers/staging/lustre/lustre/mdc/mdc_lib.c|  12 +
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |  93 ++---
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   2 +-
 drivers/staging/lustre/lustre/obdclass/cl_page.c   |  46 +++
 drivers/staging/lustre/lustre/osc/osc_cache.c  |   4 +-
 .../staging/lustre/lustre/osc/osc_cl_internal.h|   2 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c   |  18 +-
 drivers/staging/lustre/lustre/osc/osc_page.c   |   4 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|  12 +-
 drivers/staging/lustre/lustre/ptlrpc/client.c  | 159 
 drivers/staging/lustre/lustre/ptlrpc/events.c  |  30 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c  |   3 +-
 drivers/staging/lustre/lustre/ptlrpc/niobuf.c  |  20 +-
 .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h |  43 +++
 drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/sec.c |   9 +-
 drivers/staging/lustre/sysfs-fs-lustre |   8 +
 46 files changed, 

[PATCH 01/28] staging/lustre/llite: allocate and free client cache asynchronously

2016-06-19 Thread Oleg Drokin
From: Emoly Liu 

Since the inflight request holds import refcount as well as export,
sometimes obd_disconnect() in client_common_put_super() can't put
the last refcount of OSC import (e.g. due to network disconnection),
this will cause cl_cache being accessed after free.

To fix this issue, ccc_users is used as cl_cache refcount, and
lov/llite/osc all hold one cl_cache refcount respectively, to avoid
the race that a new OST is being added into the system when the client
is mounted.
The following cl_cache functions are added:
- cl_cache_init(): allocate and initialize cl_cache
- cl_cache_incref(): increase cl_cache refcount
- cl_cache_decref(): decrease cl_cache refcount and free the cache
  if refcount=0.

Signed-off-by: Emoly Liu 
Reviewed-on: http://review.whamcloud.com/13746
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6173
Reviewed-by: Niu Yawei 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h  | 10 -
 drivers/staging/lustre/lustre/include/obd.h|  2 +-
 .../staging/lustre/lustre/llite/llite_internal.h   |  2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c| 35 +++-
 drivers/staging/lustre/lustre/llite/lproc_llite.c  |  6 +--
 drivers/staging/lustre/lustre/lov/lov_obd.c|  7 
 drivers/staging/lustre/lustre/obdclass/cl_page.c   | 46 ++
 drivers/staging/lustre/lustre/osc/osc_page.c   |  4 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|  4 +-
 9 files changed, 86 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 36ca935..3cd4a25 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -2322,7 +2322,8 @@ void cl_lock_descr_print(const struct lu_env *env, void 
*cookie,
  */
 struct cl_client_cache {
/**
-* # of users (OSCs)
+* # of client cache refcount
+* # of users (OSCs) + 2 (held by llite and lov)
 */
atomic_tccc_users;
/**
@@ -2357,6 +2358,13 @@ struct cl_client_cache {
 
 };
 
+/**
+ * cl_cache functions
+ */
+struct cl_client_cache *cl_cache_init(unsigned long lru_page_max);
+void cl_cache_incref(struct cl_client_cache *cache);
+void cl_cache_decref(struct cl_client_cache *cache);
+
 /** @} cl_page */
 
 /** \defgroup cl_lock cl_lock
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index e654d42..ed1081a 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -415,7 +415,7 @@ struct lov_obd {
enum lustre_sec_partlov_sp_me;
 
/* Cached LRU and unstable data from upper layer */
-   void   *lov_cache;
+   struct cl_client_cache *lov_cache;
 
struct rw_semaphore lov_notify_lock;
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h 
b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 7c1a3254..74cd241 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -493,7 +493,7 @@ struct ll_sb_info {
 * any page which is sent to a server as part of a bulk request,
 * but is uncommitted to stable storage.
 */
-   struct cl_client_cachell_cache;
+   struct cl_client_cache*ll_cache;
 
struct lprocfs_stats *ll_ra_stats;
 
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c 
b/drivers/staging/lustre/lustre/llite/llite_lib.c
index ac833db..83f4e1a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -83,15 +83,11 @@ static struct ll_sb_info *ll_init_sbi(struct super_block 
*sb)
pages = si.totalram - si.totalhigh;
lru_page_max = pages / 2;
 
-   /* initialize ll_cache data */
-   atomic_set(>ll_cache.ccc_users, 0);
-   sbi->ll_cache.ccc_lru_max = lru_page_max;
-   atomic_set(>ll_cache.ccc_lru_left, lru_page_max);
-   spin_lock_init(>ll_cache.ccc_lru_lock);
-   INIT_LIST_HEAD(>ll_cache.ccc_lru);
-
-   atomic_set(>ll_cache.ccc_unstable_nr, 0);
-   init_waitqueue_head(>ll_cache.ccc_unstable_waitq);
+   sbi->ll_cache = cl_cache_init(lru_page_max);
+   if (!sbi->ll_cache) {
+   kfree(sbi);
+   return NULL;
+   }
 
sbi->ll_ra_info.ra_max_pages_per_file = min(pages / 32,
   SBI_DEFAULT_READAHEAD_MAX);
@@ -131,6 +127,11 @@ static void ll_free_sbi(struct super_block *sb)
 {
struct ll_sb_info *sbi = ll_s2sbi(sb);
 
+   if (sbi->ll_cache) {
+   cl_cache_decref(sbi->ll_cache);
+   sbi->ll_cache = NULL;
+   }
+
kfree(sbi);
 }
 
@@ -514,8 

[PATCH 02/28] staging/lustre/llite: correct request handling after ll_lookup_it()

2016-06-19 Thread Oleg Drokin
From: "John L. Hammond" 

In the FIFO cases of ll_atomic_open() and ll_lookup_nd() remove
spurious calls to ptlrpc_req_finished(). Explain that these cases are
unreachable in practice anyway.

Signed-off-by: John L. Hammond 
Reviewed-on: http://review.whamcloud.com/17068
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7402
Reviewed-by: Dmitry Eremin 
Reviewed-by: Lai Siyao 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/namei.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index d7459bd..6414d52 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -622,13 +622,10 @@ static int ll_atomic_open(struct inode *dir, struct 
dentry *dentry,
if (d_really_is_positive(dentry) && it_disposition(it, 
DISP_OPEN_OPEN)) {
/* Open dentry. */
if (S_ISFIFO(d_inode(dentry)->i_mode)) {
-   /* We cannot call open here as it would
-* deadlock.
+   /* We cannot call open here as it might
+* deadlock. This case is unreachable in
+* practice because of OBD_CONNECT_NODEVOH.
 */
-   if (it_disposition(it, DISP_ENQ_OPEN_REF))
-   ptlrpc_req_finished(
-  (struct ptlrpc_request *)
- it->d.lustre.it_data);
rc = finish_no_open(file, de);
} else {
file->private_data = it;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: dgnc: add __exit macro to dgnc_driver.c

2016-06-19 Thread Joshua Houghton
On Saturday, 18 June 2016 19:42:07 UTC Joshua Houghton wrote:
> Add the __exit macro to the dgnc_cleanup_module(void) function
> in dgnc_driver.c
> 
> Signed-off-by: Joshua Houghton 
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c
> b/drivers/staging/dgnc/dgnc_driver.c index af2e835..2c3fb2a 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -158,7 +158,7 @@ static void cleanup(bool sysfiles)
>   *
>   * Module unload.  This is where it all ends.
>   */
> -static void dgnc_cleanup_module(void)
> +static void __exit dgnc_cleanup_module(void)
>  {
>   cleanup(true);
>   pci_unregister_driver(_driver);

Forgot to CC in Greg Kroah-Hartman
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/3] staging: luster: Checkpatch Cleanup

2016-06-19 Thread Craig Inches
I did build the kernel 1 for each change, then a final with all changes
applied.

Apologies if I missed something,

Craig

On Sat, Jun 18, 2016 at 07:02:35PM -0700, Greg Kroah-Hartman wrote:
> On Sat, Jun 18, 2016 at 10:25:55PM +0100, Craig Inches wrote:
> > Macros with complex values should be enclosed in parenthesis
> > 
> > Signed-off-by: Craig Inches 
> > ---
> >  drivers/staging/lustre/lustre/include/cl_object.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> ALWAYS test build your patches, to not do so just makes maintainers
> grumpy...
> 
> Remember, checkpatch is a _hint_, it's not always right.
> 
> greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: esp8089: add new driver

2016-06-19 Thread kbuild test robot
Hi,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.7-rc3 next-20160617]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Icenowy-Zheng/staging-esp8089-add-new-driver/20160619-182134
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k 

All warnings (new ones prefixed by >>):

>> drivers/staging/esp8089/esp_mac80211.c:1377:2: warning: initialization from 
>> incompatible pointer type
 .ampdu_action = esp_op_ampdu_action,
 ^
   drivers/staging/esp8089/esp_mac80211.c:1377:2: warning: (near initialization 
for 'esp_mac80211_ops.ampdu_action')

vim +1377 drivers/staging/esp8089/esp_mac80211.c

  1361  .update_tkip_key = esp_op_update_tkip_key,
  1362  //.sched_scan_start = esp_op_sched_scan_start,
  1363  //.sched_scan_stop = esp_op_sched_scan_stop,
  1364  .set_rts_threshold = esp_op_set_rts_threshold,
  1365  .sta_notify = esp_op_sta_notify,
  1366  .conf_tx = esp_op_conf_tx,
  1367  .change_interface = esp_op_change_interface,
  1368  .get_tsf = esp_op_get_tsf,
  1369  .set_tsf = esp_op_set_tsf,
  1370  .reset_tsf = esp_op_reset_tsf,
  1371  .rfkill_poll = esp_op_rfkill_poll,
  1372  #ifdef HW_SCAN
  1373  .hw_scan = esp_op_hw_scan,
  1374  .remain_on_channel = esp_op_remain_on_channel,
  1375  .cancel_remain_on_channel = esp_op_cancel_remain_on_channel,
  1376  #endif
> 1377  .ampdu_action = esp_op_ampdu_action,
  1378  //.get_survey = esp_op_get_survey,
  1379  .sta_add = esp_op_sta_add,
  1380  .sta_remove = esp_op_sta_remove,
  1381  #ifdef CONFIG_NL80211_TESTMODE
  1382  //CFG80211_TESTMODE_CMD(esp_op_tm_cmd)
  1383  #endif
  1384  .set_bitrate_mask = esp_op_set_bitrate_mask,
  1385  .flush = esp_op_flush,

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: esp8089: add new driver

2016-06-19 Thread kbuild test robot
Hi,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.7-rc3 next-20160617]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Icenowy-Zheng/staging-esp8089-add-new-driver/20160619-182134
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/string.h:2:0,
from include/linux/string.h:18,
from arch/x86/include/asm/page_32.h:34,
from arch/x86/include/asm/page.h:13,
from arch/x86/include/asm/thread_info.h:11,
from include/linux/thread_info.h:54,
from arch/x86/include/asm/preempt.h:6,
from include/linux/preempt.h:59,
from include/linux/spinlock.h:50,
from include/linux/mm_types.h:8,
from include/linux/kmemcheck.h:4,
from include/linux/skbuff.h:18,
from include/linux/if_ether.h:23,
from include/linux/etherdevice.h:25,
from drivers/staging/esp8089/esp_mac80211.c:7:
   drivers/staging/esp8089/esp_mac80211.c: In function 'beacon_tim_init':
>> arch/x86/include/asm/string_32.h:325:29: warning: 'memset' used with 
>> constant zero length parameter; this could be due to transposed parameters 
>> [-Wmemset-transposed-args]
#define memset(s, c, count) __builtin_memset(s, c, count)
^
>> drivers/staging/esp8089/esp_mac80211.c:325:2: note: in expansion of macro 
>> 'memset'
 memset(beacon_tim_saved, BEACON_TIM_SAVE_MAX, 0);
 ^~
   drivers/staging/esp8089/esp_mac80211.c: At top level:
   drivers/staging/esp8089/esp_mac80211.c:1377:18: error: initialization from 
incompatible pointer type [-Werror=incompatible-pointer-types]
 .ampdu_action = esp_op_ampdu_action,
 ^~~
   drivers/staging/esp8089/esp_mac80211.c:1377:18: note: (near initialization 
for 'esp_mac80211_ops.ampdu_action')
   cc1: some warnings being treated as errors

vim +/memset +325 drivers/staging/esp8089/esp_mac80211.c

   309  }
   310  epub->vif = NULL;
   311  evif->epub = NULL;
   312  
   313  sip_cmd(epub, SIP_CMD_SETVIF, (u8 *) & svif,
   314  sizeof(struct sip_cmd_setvif));
   315  
   316  /* clean up tx/rx queue */
   317  
   318  }
   319  
   320  #define BEACON_TIM_SAVE_MAX 20
   321  u8 beacon_tim_saved[BEACON_TIM_SAVE_MAX];
   322  int beacon_tim_count;
   323  static void beacon_tim_init(void)
   324  {
 > 325  memset(beacon_tim_saved, BEACON_TIM_SAVE_MAX, 0);
   326  beacon_tim_count = 0;
   327  }
   328  
   329  static u8 beacon_tim_save(u8 this_tim)
   330  {
   331  u8 all_tim = 0;
   332  int i;
   333  beacon_tim_saved[beacon_tim_count] = this_tim;

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: esp8089: add new driver

2016-06-19 Thread kbuild test robot
Hi,

[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.7-rc3 next-20160617]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Icenowy-Zheng/staging-esp8089-add-new-driver/20160619-182134
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.1.1-1) 6.1.1 20160430
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   drivers/staging/esp8089/esp_mac80211.c: In function 'beacon_tim_init':
>> drivers/staging/esp8089/esp_mac80211.c:325:2: warning: 'memset' used with 
>> constant zero length parameter; this could be due to transposed parameters 
>> [-Wmemset-transposed-args]
 memset(beacon_tim_saved, BEACON_TIM_SAVE_MAX, 0);
 ^~
   drivers/staging/esp8089/esp_mac80211.c: At top level:
>> drivers/staging/esp8089/esp_mac80211.c:1377:18: error: initialization from 
>> incompatible pointer type [-Werror=incompatible-pointer-types]
 .ampdu_action = esp_op_ampdu_action,
 ^~~
   drivers/staging/esp8089/esp_mac80211.c:1377:18: note: (near initialization 
for 'esp_mac80211_ops.ampdu_action')
   cc1: some warnings being treated as errors

vim +1377 drivers/staging/esp8089/esp_mac80211.c

  1371  .rfkill_poll = esp_op_rfkill_poll,
  1372  #ifdef HW_SCAN
  1373  .hw_scan = esp_op_hw_scan,
  1374  .remain_on_channel = esp_op_remain_on_channel,
  1375  .cancel_remain_on_channel = esp_op_cancel_remain_on_channel,
  1376  #endif
> 1377  .ampdu_action = esp_op_ampdu_action,
  1378  //.get_survey = esp_op_get_survey,
  1379  .sta_add = esp_op_sta_add,
  1380  .sta_remove = esp_op_sta_remove,

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/2] PCI: hv: fix a couple of issues in hv_pci_onchannelcallback()

2016-06-19 Thread Vitaly Kuznetsov
Bjorn Helgaas  writes:

> On Fri, Jun 10, 2016 at 06:53:36PM -0500, Bjorn Helgaas wrote:
>> On Mon, May 30, 2016 at 04:17:57PM +0200, Vitaly Kuznetsov wrote:
>> > kmemleak helped me to identify a memory leak in hv_pci_onchannelcallback()
>> > and while fixing it I stumbled upon an unrelated issue(s) there.
>> > 
>> > Vitaly Kuznetsov (2):
>> >   PCI: hv: don't leak buffer in hv_pci_onchannelcallback()
>> >   PCI: hv: handle all pending messages in hv_pci_onchannelcallback()
>> 
>> I applied both to for-linus for v4.7 with Jake's acks, thanks, Vitaly.
>
> Somehow I must have been thinking these were fixes for things we
> merged or broke during the v4.7 merge window, but that doesn't look
> like the case.  So I'm going to merge these for v4.8 instead, on the
> theory that the v4.7-rc cycles are primarily for stabilization.

Right, this is not a 4.7 regression.

Thanks!

-- 
  Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel