diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/Kconfig | 2 | ||||
-rw-r--r-- | fs/bio.c | 28 | ||||
-rw-r--r-- | fs/compat.c | 2 | ||||
-rw-r--r-- | fs/sysfs/dir.c | 4 |
4 files changed, 21 insertions, 15 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index 2126078a38ed..64d44efad7a5 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -135,7 +135,7 @@ config TMPFS_POSIX_ACL | |||
135 | 135 | ||
136 | config HUGETLBFS | 136 | config HUGETLBFS |
137 | bool "HugeTLB file system support" | 137 | bool "HugeTLB file system support" |
138 | depends on X86 || IA64 || PPC_BOOK3S_64 || SPARC64 || (S390 && 64BIT) || \ | 138 | depends on X86 || IA64 || SPARC64 || (S390 && 64BIT) || \ |
139 | SYS_SUPPORTS_HUGETLBFS || BROKEN | 139 | SYS_SUPPORTS_HUGETLBFS || BROKEN |
140 | help | 140 | help |
141 | hugetlbfs is a filesystem backing for HugeTLB pages, based on | 141 | hugetlbfs is a filesystem backing for HugeTLB pages, based on |
@@ -325,8 +325,16 @@ static void bio_fs_destructor(struct bio *bio) | |||
325 | * @gfp_mask: allocation mask to use | 325 | * @gfp_mask: allocation mask to use |
326 | * @nr_iovecs: number of iovecs | 326 | * @nr_iovecs: number of iovecs |
327 | * | 327 | * |
328 | * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask | 328 | * bio_alloc will allocate a bio and associated bio_vec array that can hold |
329 | * contains __GFP_WAIT, the allocation is guaranteed to succeed. | 329 | * at least @nr_iovecs entries. Allocations will be done from the |
330 | * fs_bio_set. Also see @bio_alloc_bioset and @bio_kmalloc. | ||
331 | * | ||
332 | * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate | ||
333 | * a bio. This is due to the mempool guarantees. To make this work, callers | ||
334 | * must never allocate more than 1 bio at a time from this pool. Callers | ||
335 | * that need to allocate more than 1 bio must always submit the previously | ||
336 | * allocated bio for IO before attempting to allocate a new one. Failure to | ||
337 | * do so can cause livelocks under memory pressure. | ||
330 | * | 338 | * |
331 | * RETURNS: | 339 | * RETURNS: |
332 | * Pointer to new bio on success, NULL on failure. | 340 | * Pointer to new bio on success, NULL on failure. |
@@ -350,21 +358,13 @@ static void bio_kmalloc_destructor(struct bio *bio) | |||
350 | } | 358 | } |
351 | 359 | ||
352 | /** | 360 | /** |
353 | * bio_alloc - allocate a bio for I/O | 361 | * bio_kmalloc - allocate a bio for I/O using kmalloc() |
354 | * @gfp_mask: the GFP_ mask given to the slab allocator | 362 | * @gfp_mask: the GFP_ mask given to the slab allocator |
355 | * @nr_iovecs: number of iovecs to pre-allocate | 363 | * @nr_iovecs: number of iovecs to pre-allocate |
356 | * | 364 | * |
357 | * Description: | 365 | * Description: |
358 | * bio_alloc will allocate a bio and associated bio_vec array that can hold | 366 | * Allocate a new bio with @nr_iovecs bvecs. If @gfp_mask contains |
359 | * at least @nr_iovecs entries. Allocations will be done from the | 367 | * %__GFP_WAIT, the allocation is guaranteed to succeed. |
360 | * fs_bio_set. Also see @bio_alloc_bioset. | ||
361 | * | ||
362 | * If %__GFP_WAIT is set, then bio_alloc will always be able to allocate | ||
363 | * a bio. This is due to the mempool guarantees. To make this work, callers | ||
364 | * must never allocate more than 1 bio at a time from this pool. Callers | ||
365 | * that need to allocate more than 1 bio must always submit the previously | ||
366 | * allocated bio for IO before attempting to allocate a new one. Failure to | ||
367 | * do so can cause livelocks under memory pressure. | ||
368 | * | 368 | * |
369 | **/ | 369 | **/ |
370 | struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) | 370 | struct bio *bio_kmalloc(gfp_t gfp_mask, int nr_iovecs) |
@@ -407,7 +407,7 @@ EXPORT_SYMBOL(zero_fill_bio); | |||
407 | * | 407 | * |
408 | * Description: | 408 | * Description: |
409 | * Put a reference to a &struct bio, either one you have gotten with | 409 | * Put a reference to a &struct bio, either one you have gotten with |
410 | * bio_alloc or bio_get. The last put of a bio will free it. | 410 | * bio_alloc, bio_get or bio_clone. The last put of a bio will free it. |
411 | **/ | 411 | **/ |
412 | void bio_put(struct bio *bio) | 412 | void bio_put(struct bio *bio) |
413 | { | 413 | { |
diff --git a/fs/compat.c b/fs/compat.c index d576b552e8e2..6c19040ffeef 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1532,6 +1532,8 @@ int compat_do_execve(char * filename, | |||
1532 | if (retval < 0) | 1532 | if (retval < 0) |
1533 | goto out; | 1533 | goto out; |
1534 | 1534 | ||
1535 | current->stack_start = current->mm->start_stack; | ||
1536 | |||
1535 | /* execve succeeded */ | 1537 | /* execve succeeded */ |
1536 | current->fs->in_exec = 0; | 1538 | current->fs->in_exec = 0; |
1537 | current->in_execve = 0; | 1539 | current->in_execve = 0; |
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 5fad489ce5bc..e0201837d244 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/completion.h> | 21 | #include <linux/completion.h> |
22 | #include <linux/mutex.h> | 22 | #include <linux/mutex.h> |
23 | #include <linux/slab.h> | 23 | #include <linux/slab.h> |
24 | #include <linux/security.h> | ||
24 | #include "sysfs.h" | 25 | #include "sysfs.h" |
25 | 26 | ||
26 | DEFINE_MUTEX(sysfs_mutex); | 27 | DEFINE_MUTEX(sysfs_mutex); |
@@ -285,6 +286,9 @@ void release_sysfs_dirent(struct sysfs_dirent * sd) | |||
285 | sysfs_put(sd->s_symlink.target_sd); | 286 | sysfs_put(sd->s_symlink.target_sd); |
286 | if (sysfs_type(sd) & SYSFS_COPY_NAME) | 287 | if (sysfs_type(sd) & SYSFS_COPY_NAME) |
287 | kfree(sd->s_name); | 288 | kfree(sd->s_name); |
289 | if (sd->s_iattr && sd->s_iattr->ia_secdata) | ||
290 | security_release_secctx(sd->s_iattr->ia_secdata, | ||
291 | sd->s_iattr->ia_secdata_len); | ||
288 | kfree(sd->s_iattr); | 292 | kfree(sd->s_iattr); |
289 | sysfs_free_ino(sd->s_ino); | 293 | sysfs_free_ino(sd->s_ino); |
290 | kmem_cache_free(sysfs_dir_cachep, sd); | 294 | kmem_cache_free(sysfs_dir_cachep, sd); |