diff options
Diffstat (limited to 'kernel/user_namespace.c')
| -rw-r--r-- | kernel/user_namespace.c | 11 | 
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 0d8f6023fd8d..bf71b4b2d632 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c  | |||
| @@ -152,7 +152,7 @@ static u32 map_id_range_down(struct uid_gid_map *map, u32 id, u32 count) | |||
| 152 | 152 | ||
| 153 | /* Find the matching extent */ | 153 | /* Find the matching extent */ | 
| 154 | extents = map->nr_extents; | 154 | extents = map->nr_extents; | 
| 155 | smp_read_barrier_depends(); | 155 | smp_rmb(); | 
| 156 | for (idx = 0; idx < extents; idx++) { | 156 | for (idx = 0; idx < extents; idx++) { | 
| 157 | first = map->extent[idx].first; | 157 | first = map->extent[idx].first; | 
| 158 | last = first + map->extent[idx].count - 1; | 158 | last = first + map->extent[idx].count - 1; | 
| @@ -176,7 +176,7 @@ static u32 map_id_down(struct uid_gid_map *map, u32 id) | |||
| 176 | 176 | ||
| 177 | /* Find the matching extent */ | 177 | /* Find the matching extent */ | 
| 178 | extents = map->nr_extents; | 178 | extents = map->nr_extents; | 
| 179 | smp_read_barrier_depends(); | 179 | smp_rmb(); | 
| 180 | for (idx = 0; idx < extents; idx++) { | 180 | for (idx = 0; idx < extents; idx++) { | 
| 181 | first = map->extent[idx].first; | 181 | first = map->extent[idx].first; | 
| 182 | last = first + map->extent[idx].count - 1; | 182 | last = first + map->extent[idx].count - 1; | 
| @@ -199,7 +199,7 @@ static u32 map_id_up(struct uid_gid_map *map, u32 id) | |||
| 199 | 199 | ||
| 200 | /* Find the matching extent */ | 200 | /* Find the matching extent */ | 
| 201 | extents = map->nr_extents; | 201 | extents = map->nr_extents; | 
| 202 | smp_read_barrier_depends(); | 202 | smp_rmb(); | 
| 203 | for (idx = 0; idx < extents; idx++) { | 203 | for (idx = 0; idx < extents; idx++) { | 
| 204 | first = map->extent[idx].lower_first; | 204 | first = map->extent[idx].lower_first; | 
| 205 | last = first + map->extent[idx].count - 1; | 205 | last = first + map->extent[idx].count - 1; | 
| @@ -615,9 +615,8 @@ static ssize_t map_write(struct file *file, const char __user *buf, | |||
| 615 | * were written before the count of the extents. | 615 | * were written before the count of the extents. | 
| 616 | * | 616 | * | 
| 617 | * To achieve this smp_wmb() is used on guarantee the write | 617 | * To achieve this smp_wmb() is used on guarantee the write | 
| 618 | * order and smp_read_barrier_depends() is guaranteed that we | 618 | * order and smp_rmb() is guaranteed that we don't have crazy | 
| 619 | * don't have crazy architectures returning stale data. | 619 | * architectures returning stale data. | 
| 620 | * | ||
| 621 | */ | 620 | */ | 
| 622 | mutex_lock(&id_map_mutex); | 621 | mutex_lock(&id_map_mutex); | 
| 623 | 622 | ||
