summaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSrinivasarao P <spathi@codeaurora.org>2019-11-11 13:36:21 +0530
committerSrinivasarao P <spathi@codeaurora.org>2019-11-13 10:41:54 +0530
commit4547f0febbca55057d4249dd6e4e6d509dbc2e46 (patch)
treeec637812dd3ecac1ad63d6a660dd3ccba36159d4 /fs/cifs/file.c
parente4d7a03a831cad51763254599c6940bf598e6c75 (diff)
parent903fbe76b8a529ed16170944178eb7e2b41e7991 (diff)
Merge android-4.4-p.200 (903fbe7) into msm-4.4
* refs/heads/tmp-903fbe7 Linux 4.4.200 alarmtimer: Change remaining ENOTSUPP to EOPNOTSUPP ARM: fix the cockup in the previous patch ARM: ensure that processor vtables is not lost after boot ARM: spectre-v2: per-CPU vtables to work around big.Little systems ARM: add PROC_VTABLE and PROC_TABLE macros ARM: clean up per-processor check_bugs method call ARM: split out processor lookup ARM: make lookup_processor_type() non-__init ARM: 8810/1: vfp: Fix wrong assignement to ufp_exc ARM: 8796/1: spectre-v1,v1.1: provide helpers for address sanitization ARM: 8795/1: spectre-v1.1: use put_user() for __put_user() ARM: 8794/1: uaccess: Prevent speculative use of the current addr_limit ARM: 8793/1: signal: replace __put_user_error with __put_user ARM: 8792/1: oabi-compat: copy oabi events using __copy_to_user() ARM: 8791/1: vfp: use __copy_to_user() when saving VFP state ARM: 8789/1: signal: copy registers using __copy_to_user() ARM: spectre-v1: mitigate user accesses ARM: spectre-v1: use get_user() for __get_user() ARM: use __inttype() in get_user() ARM: oabi-compat: copy semops using __copy_from_user() ARM: vfp: use __copy_from_user() when restoring VFP state ARM: signal: copy registers using __copy_from_user() ARM: spectre-v1: fix syscall entry ARM: spectre-v1: add array_index_mask_nospec() implementation ARM: spectre-v1: add speculation barrier (csdb) macros ARM: spectre-v2: warn about incorrect context switching functions ARM: spectre-v2: add firmware based hardening ARM: spectre-v2: harden user aborts in kernel space ARM: spectre-v2: add Cortex A8 and A15 validation of the IBE bit ARM: spectre-v2: harden branch predictor on context switches ARM: spectre: add Kconfig symbol for CPUs vulnerable to Spectre ARM: bugs: add support for per-processor bug checking ARM: bugs: hook processor bug checking into SMP and suspend paths ARM: bugs: prepare processor bug infrastructure ARM: add more CPU part numbers for Cortex and Brahma B15 CPUs arm/arm64: smccc-1.1: Handle function result as parameters arm/arm64: smccc-1.1: Make return values unsigned long arm/arm64: smccc: Add SMCCC-specific return codes arm/arm64: smccc: Implement SMCCC v1.1 inline primitive arm/arm64: smccc: Make function identifiers an unsigned quantity firmware/psci: Expose SMCCC version through psci_ops firmware/psci: Expose PSCI conduit arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support arm/arm64: KVM: Advertise SMCCC v1.1 ARM: Move system register accessors to asm/cp15.h ARM: uaccess: remove put_user() code duplication ARM: 8481/2: drivers: psci: replace psci firmware calls ARM: 8480/2: arm64: add implementation for arm-smccc ARM: 8479/2: add implementation for arm-smccc ARM: 8478/2: arm/arm64: add arm-smccc ARM: 8051/1: put_user: fix possible data corruption in put_user dmaengine: qcom: bam_dma: Fix resource leak net/flow_dissector: switch to siphash inet: stop leaking jiffies on the wire net/mlx4_core: Dynamically set guaranteed amount of counters per VF vxlan: check tun_info options_len properly net: add READ_ONCE() annotation in __skb_wait_for_more_packets() net: Zeroing the structure ethtool_wolinfo in ethtool_get_wol() net: hisilicon: Fix ping latency when deal with high throughput net: fix sk_page_frag() recursion from memory reclaim dccp: do not leak jiffies on the wire cifs: Fix cifsInodeInfo lock_sem deadlock when reconnect occurs MIPS: bmips: mark exception vectors as char arrays of: unittest: fix memory leak in unittest_data_add scsi: target: core: Do not overwrite CDB byte 1 perf kmem: Fix memory leak in compact_gfp_flags() scsi: fix kconfig dependency warning related to 53C700_LE_ON_BE scsi: sni_53c710: fix compilation error ARM: mm: fix alignment handler faults under memory pressure ARM: dts: logicpd-torpedo-som: Remove twl_keypad ASoc: rockchip: i2s: Fix RPM imbalance regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized regulator: ti-abb: Fix timeout in ti_abb_wait_txdone/ti_abb_clear_all_txdone kbuild: add -fcf-protection=none when using retpoline flags UPSTREAM: HID: steam: fix deadlock with input devices. UPSTREAM: HID: steam: fix boot loop with bluetooth firmware UPSTREAM: HID: steam: remove input device when a hid client is running. UPSTREAM: HID: steam: use hid_device.driver_data instead of hid_set_drvdata() UPSTREAM: HID: steam: add missing fields in client initialization UPSTREAM: HID: steam: add battery device. UPSTREAM: HID: add driver for Valve Steam Controller UPSTREAM: HID: sony: Fix memory corruption issue on cleanup. UPSTREAM: HID: sony: Fix race condition between rumble and device remove. UPSTREAM: HID: sony: remove redundant check for -ve err UPSTREAM: HID: sony: Make sure to unregister sensors on failure UPSTREAM: HID: sony: Make DS4 bt poll interval adjustable UPSTREAM: HID: sony: Set proper bit flags on DS4 output report UPSTREAM: HID: sony: DS4 use brighter LED colors UPSTREAM: HID: sony: Improve navigation controller axis/button mapping UPSTREAM: HID: sony: Use DS3 MAC address as unique identifier on USB UPSTREAM: HID: sony: Perform duplicate device check earlier on UPSTREAM: HID: sony: Expose DS3 motion sensors through separate device UPSTREAM: HID: sony: Print error on failure to active DS3 / Navigation controllers UPSTREAM: HID: sony: DS3 comply to Linux gamepad spec UPSTREAM: HID: sony: Mark DS4 touchpad device as a pointer UPSTREAM: HID: sony: Support motion sensor calibration on dongle UPSTREAM: HID: sony: Make work handling more generic UPSTREAM: HID: sony: Treat the ds4 dongle as a separate device UPSTREAM: HID: sony: Remove report descriptor fixup for DS4 UPSTREAM: HID: sony: Report hardware timestamp for DS4 sensor values UPSTREAM: HID: sony: Calibrate DS4 motion sensors UPSTREAM: HID: sony: Report DS4 motion sensors through a separate device UPSTREAM: HID: sony: Fix input device leak when connecting a DS4 twice using USB/BT UPSTREAM: HID: sony: Use LED_CORE_SUSPENDRESUME UPSTREAM: HID: sony: Ignore DS4 dongle reports when no device is connected UPSTREAM: HID: sony: Use DS4 MAC address as unique identifier on USB UPSTREAM: HID: sony: Fix error handling bug when touchpad registration fails UPSTREAM: HID: sony: Comply to Linux gamepad spec for DS4 UPSTREAM: HID: sony: Make the DS4 touchpad a separate device UPSTREAM: HID: sony: Fix memory issue when connecting device using both Bluetooth and USB UPSTREAM: HID: sony: Adjust value range for motion sensors UPSTREAM: HID: sony: Handle multiple touch events input record UPSTREAM: HID: sony: Send ds4 output reports on output end-point UPSTREAM: HID: sony: Perform CRC check on bluetooth input packets UPSTREAM: HID: sony: Adjust HID report size name definitions UPSTREAM: HID: sony: Fix race condition in sony_probe UPSTREAM: HID: sony: Update copyright and add Dualshock 4 rate control note UPSTREAM: HID: sony: Defer the initial USB Sixaxis output report UPSTREAM: HID: sony: Relax duplicate checking for USB-only devices UPSTREAM: HID: sony: underscores are unnecessary for u8, u16, s32 UPSTREAM: HID: sony: fix some warnings from scripts/checkpatch.pl UPSTREAM: HID: sony: fix errors from scripts/checkpatch.pl UPSTREAM: HID: sony: fix a typo in descriptors comments s/Joystik/Joystick/ UPSTREAM: HID: sony: Fixup output reports for the nyko core controller UPSTREAM: HID: sony: Remove the size check for the Dualshock 4 HID Descriptor UPSTREAM: HID: sony: Save and restore the controller state on suspend and resume UPSTREAM: HID: sony: Refactor the output report sending functions After resolving conflicts there is no effective change from this patch fs/dcache: move security_d_instantiate() behind attaching dentry to inode Conflicts: fs/dcache.c include/linux/arm-smccc.h include/linux/psci.h Change-Id: I092fea3b6c69f56639fdb9e511e011cbb326e2c7 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 02f9e92338ef..5cad1109ed80 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -280,6 +280,13 @@ cifs_has_mand_locks(struct cifsInodeInfo *cinode)
return has_locks;
}
+void
+cifs_down_write(struct rw_semaphore *sem)
+{
+ while (!down_write_trylock(sem))
+ msleep(10);
+}
+
struct cifsFileInfo *
cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
struct tcon_link *tlink, __u32 oplock)
@@ -305,7 +312,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
INIT_LIST_HEAD(&fdlocks->locks);
fdlocks->cfile = cfile;
cfile->llist = fdlocks;
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
list_add(&fdlocks->llist, &cinode->llist);
up_write(&cinode->lock_sem);
@@ -438,7 +445,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
* Delete any outstanding lock records. We'll lose them when the file
* is closed anyway.
*/
- down_write(&cifsi->lock_sem);
+ cifs_down_write(&cifsi->lock_sem);
list_for_each_entry_safe(li, tmp, &cifs_file->llist->locks, llist) {
list_del(&li->llist);
cifs_del_lock_waiters(li);
@@ -947,7 +954,7 @@ static void
cifs_lock_add(struct cifsFileInfo *cfile, struct cifsLockInfo *lock)
{
struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
list_add_tail(&lock->llist, &cfile->llist->locks);
up_write(&cinode->lock_sem);
}
@@ -969,7 +976,7 @@ cifs_lock_add_if(struct cifsFileInfo *cfile, struct cifsLockInfo *lock,
try_again:
exist = false;
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
exist = cifs_find_lock_conflict(cfile, lock->offset, lock->length,
lock->type, &conf_lock, CIFS_LOCK_OP);
@@ -991,7 +998,7 @@ try_again:
(lock->blist.next == &lock->blist));
if (!rc)
goto try_again;
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
list_del_init(&lock->blist);
}
@@ -1044,7 +1051,7 @@ cifs_posix_lock_set(struct file *file, struct file_lock *flock)
return rc;
try_again:
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
if (!cinode->can_cache_brlcks) {
up_write(&cinode->lock_sem);
return rc;
@@ -1242,7 +1249,7 @@ cifs_push_locks(struct cifsFileInfo *cfile)
int rc = 0;
/* we are going to update can_cache_brlcks here - need a write access */
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
if (!cinode->can_cache_brlcks) {
up_write(&cinode->lock_sem);
return rc;
@@ -1430,7 +1437,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
if (!buf)
return -ENOMEM;
- down_write(&cinode->lock_sem);
+ cifs_down_write(&cinode->lock_sem);
for (i = 0; i < 2; i++) {
cur = buf;
num = 0;