Magellan Linux

Contents of /trunk/kernel-magellan/patches-4.8/0102-4.8.3-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2842 - (show annotations) (download)
Tue Nov 22 13:19:23 2016 UTC (7 years, 5 months ago) by niro
File size: 4235 byte(s)
-linux-4.8.3
1 diff --git a/Makefile b/Makefile
2 index bf6e44a421df..42eb45c86a42 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 4
7 PATCHLEVEL = 8
8 -SUBLEVEL = 2
9 +SUBLEVEL = 3
10 EXTRAVERSION =
11 NAME = Psychotic Stoned Sheep
12
13 diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
14 index ec6381e57eb7..258a3f9a2519 100644
15 --- a/drivers/scsi/hosts.c
16 +++ b/drivers/scsi/hosts.c
17 @@ -246,10 +246,6 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
18
19 shost->dma_dev = dma_dev;
20
21 - error = device_add(&shost->shost_gendev);
22 - if (error)
23 - goto out_destroy_freelist;
24 -
25 /*
26 * Increase usage count temporarily here so that calling
27 * scsi_autopm_put_host() will trigger runtime idle if there is
28 @@ -260,6 +256,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
29 pm_runtime_enable(&shost->shost_gendev);
30 device_enable_async_suspend(&shost->shost_gendev);
31
32 + error = device_add(&shost->shost_gendev);
33 + if (error)
34 + goto out_destroy_freelist;
35 +
36 scsi_host_set_state(shost, SHOST_RUNNING);
37 get_device(shost->shost_gendev.parent);
38
39 @@ -309,6 +309,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
40 out_del_gendev:
41 device_del(&shost->shost_gendev);
42 out_destroy_freelist:
43 + device_disable_async_suspend(&shost->shost_gendev);
44 + pm_runtime_disable(&shost->shost_gendev);
45 + pm_runtime_set_suspended(&shost->shost_gendev);
46 + pm_runtime_put_noidle(&shost->shost_gendev);
47 scsi_destroy_command_freelist(shost);
48 out_destroy_tags:
49 if (shost_use_blk_mq(shost))
50 diff --git a/fs/xfs/xfs_xattr.c b/fs/xfs/xfs_xattr.c
51 index ea62245fee26..62900938f26d 100644
52 --- a/fs/xfs/xfs_xattr.c
53 +++ b/fs/xfs/xfs_xattr.c
54 @@ -147,6 +147,7 @@ __xfs_xattr_put_listent(
55 arraytop = context->count + prefix_len + namelen + 1;
56 if (arraytop > context->firstu) {
57 context->count = -1; /* insufficient space */
58 + context->seen_enough = 1;
59 return 0;
60 }
61 offset = (char *)context->alist + context->count;
62 diff --git a/include/linux/mm.h b/include/linux/mm.h
63 index ef815b9cd426..277cd39a6399 100644
64 --- a/include/linux/mm.h
65 +++ b/include/linux/mm.h
66 @@ -2234,6 +2234,7 @@ static inline struct page *follow_page(struct vm_area_struct *vma,
67 #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */
68 #define FOLL_MLOCK 0x1000 /* lock present pages */
69 #define FOLL_REMOTE 0x2000 /* we are working on non-current tsk/mm */
70 +#define FOLL_COW 0x4000 /* internal GUP flag */
71
72 typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
73 void *data);
74 diff --git a/include/media/rcar-fcp.h b/include/media/rcar-fcp.h
75 index 4c7fc77eaf29..8723f05c6321 100644
76 --- a/include/media/rcar-fcp.h
77 +++ b/include/media/rcar-fcp.h
78 @@ -29,7 +29,7 @@ static inline struct rcar_fcp_device *rcar_fcp_get(const struct device_node *np)
79 static inline void rcar_fcp_put(struct rcar_fcp_device *fcp) { }
80 static inline int rcar_fcp_enable(struct rcar_fcp_device *fcp)
81 {
82 - return -ENOSYS;
83 + return 0;
84 }
85 static inline void rcar_fcp_disable(struct rcar_fcp_device *fcp) { }
86 #endif
87 diff --git a/mm/gup.c b/mm/gup.c
88 index 96b2b2fd0fbd..22cc22e7432f 100644
89 --- a/mm/gup.c
90 +++ b/mm/gup.c
91 @@ -60,6 +60,16 @@ static int follow_pfn_pte(struct vm_area_struct *vma, unsigned long address,
92 return -EEXIST;
93 }
94
95 +/*
96 + * FOLL_FORCE can write to even unwritable pte's, but only
97 + * after we've gone through a COW cycle and they are dirty.
98 + */
99 +static inline bool can_follow_write_pte(pte_t pte, unsigned int flags)
100 +{
101 + return pte_write(pte) ||
102 + ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte));
103 +}
104 +
105 static struct page *follow_page_pte(struct vm_area_struct *vma,
106 unsigned long address, pmd_t *pmd, unsigned int flags)
107 {
108 @@ -95,7 +105,7 @@ retry:
109 }
110 if ((flags & FOLL_NUMA) && pte_protnone(pte))
111 goto no_page;
112 - if ((flags & FOLL_WRITE) && !pte_write(pte)) {
113 + if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags)) {
114 pte_unmap_unlock(ptep, ptl);
115 return NULL;
116 }
117 @@ -412,7 +422,7 @@ static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma,
118 * reCOWed by userspace write).
119 */
120 if ((ret & VM_FAULT_WRITE) && !(vma->vm_flags & VM_WRITE))
121 - *flags &= ~FOLL_WRITE;
122 + *flags |= FOLL_COW;
123 return 0;
124 }
125