diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/compat_ioctl.c | 9 | ||||
| -rw-r--r-- | fs/exec.c | 21 | ||||
| -rw-r--r-- | fs/gfs2/bmap.c | 2 | ||||
| -rw-r--r-- | fs/gfs2/ops_fstype.c | 2 | ||||
| -rw-r--r-- | fs/nfs/fscache.c | 9 | ||||
| -rw-r--r-- | fs/nfs/mount_clnt.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs2xdr.c | 2 | ||||
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 6 | ||||
| -rw-r--r-- | fs/nfs/write.c | 3 |
9 files changed, 40 insertions, 16 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index c5c45de1a2ee..0ca9ec4a79c3 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
| @@ -301,6 +301,12 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, | |||
| 301 | u32 data; | 301 | u32 data; |
| 302 | void __user *dxferp; | 302 | void __user *dxferp; |
| 303 | int err; | 303 | int err; |
| 304 | int interface_id; | ||
| 305 | |||
| 306 | if (get_user(interface_id, &sgio32->interface_id)) | ||
| 307 | return -EFAULT; | ||
| 308 | if (interface_id != 'S') | ||
| 309 | return sys_ioctl(fd, cmd, (unsigned long)sgio32); | ||
| 304 | 310 | ||
| 305 | if (get_user(iovec_count, &sgio32->iovec_count)) | 311 | if (get_user(iovec_count, &sgio32->iovec_count)) |
| 306 | return -EFAULT; | 312 | return -EFAULT; |
| @@ -936,6 +942,7 @@ COMPATIBLE_IOCTL(TCSETSF) | |||
| 936 | COMPATIBLE_IOCTL(TIOCLINUX) | 942 | COMPATIBLE_IOCTL(TIOCLINUX) |
| 937 | COMPATIBLE_IOCTL(TIOCSBRK) | 943 | COMPATIBLE_IOCTL(TIOCSBRK) |
| 938 | COMPATIBLE_IOCTL(TIOCCBRK) | 944 | COMPATIBLE_IOCTL(TIOCCBRK) |
| 945 | COMPATIBLE_IOCTL(TIOCGSID) | ||
| 939 | COMPATIBLE_IOCTL(TIOCGICOUNT) | 946 | COMPATIBLE_IOCTL(TIOCGICOUNT) |
| 940 | /* Little t */ | 947 | /* Little t */ |
| 941 | COMPATIBLE_IOCTL(TIOCGETD) | 948 | COMPATIBLE_IOCTL(TIOCGETD) |
| @@ -1038,6 +1045,8 @@ COMPATIBLE_IOCTL(FIOQSIZE) | |||
| 1038 | #ifdef CONFIG_BLOCK | 1045 | #ifdef CONFIG_BLOCK |
| 1039 | /* loop */ | 1046 | /* loop */ |
| 1040 | IGNORE_IOCTL(LOOP_CLR_FD) | 1047 | IGNORE_IOCTL(LOOP_CLR_FD) |
| 1048 | /* md calls this on random blockdevs */ | ||
| 1049 | IGNORE_IOCTL(RAID_VERSION) | ||
| 1041 | /* SG stuff */ | 1050 | /* SG stuff */ |
| 1042 | COMPATIBLE_IOCTL(SG_SET_TIMEOUT) | 1051 | COMPATIBLE_IOCTL(SG_SET_TIMEOUT) |
| 1043 | COMPATIBLE_IOCTL(SG_GET_TIMEOUT) | 1052 | COMPATIBLE_IOCTL(SG_GET_TIMEOUT) |
| @@ -571,6 +571,9 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
| 571 | struct vm_area_struct *prev = NULL; | 571 | struct vm_area_struct *prev = NULL; |
| 572 | unsigned long vm_flags; | 572 | unsigned long vm_flags; |
| 573 | unsigned long stack_base; | 573 | unsigned long stack_base; |
| 574 | unsigned long stack_size; | ||
| 575 | unsigned long stack_expand; | ||
| 576 | unsigned long rlim_stack; | ||
| 574 | 577 | ||
| 575 | #ifdef CONFIG_STACK_GROWSUP | 578 | #ifdef CONFIG_STACK_GROWSUP |
| 576 | /* Limit stack size to 1GB */ | 579 | /* Limit stack size to 1GB */ |
| @@ -627,10 +630,24 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
| 627 | goto out_unlock; | 630 | goto out_unlock; |
| 628 | } | 631 | } |
| 629 | 632 | ||
| 633 | stack_expand = EXTRA_STACK_VM_PAGES * PAGE_SIZE; | ||
| 634 | stack_size = vma->vm_end - vma->vm_start; | ||
| 635 | /* | ||
| 636 | * Align this down to a page boundary as expand_stack | ||
| 637 | * will align it up. | ||
| 638 | */ | ||
| 639 | rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK; | ||
| 640 | rlim_stack = min(rlim_stack, stack_size); | ||
| 630 | #ifdef CONFIG_STACK_GROWSUP | 641 | #ifdef CONFIG_STACK_GROWSUP |
| 631 | stack_base = vma->vm_end + EXTRA_STACK_VM_PAGES * PAGE_SIZE; | 642 | if (stack_size + stack_expand > rlim_stack) |
| 643 | stack_base = vma->vm_start + rlim_stack; | ||
| 644 | else | ||
| 645 | stack_base = vma->vm_end + stack_expand; | ||
| 632 | #else | 646 | #else |
| 633 | stack_base = vma->vm_start - EXTRA_STACK_VM_PAGES * PAGE_SIZE; | 647 | if (stack_size + stack_expand > rlim_stack) |
| 648 | stack_base = vma->vm_end - rlim_stack; | ||
| 649 | else | ||
| 650 | stack_base = vma->vm_start - stack_expand; | ||
| 634 | #endif | 651 | #endif |
| 635 | ret = expand_stack(vma, stack_base); | 652 | ret = expand_stack(vma, stack_base); |
| 636 | if (ret) | 653 | if (ret) |
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 6d47379e794b..583e823307ae 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
| @@ -541,7 +541,7 @@ static int gfs2_bmap_alloc(struct inode *inode, const sector_t lblock, | |||
| 541 | *ptr++ = cpu_to_be64(bn++); | 541 | *ptr++ = cpu_to_be64(bn++); |
| 542 | break; | 542 | break; |
| 543 | } | 543 | } |
| 544 | } while (state != ALLOC_DATA); | 544 | } while ((state != ALLOC_DATA) || !dblock); |
| 545 | 545 | ||
| 546 | ip->i_height = height; | 546 | ip->i_height = height; |
| 547 | gfs2_add_inode_blocks(&ip->i_inode, alloced); | 547 | gfs2_add_inode_blocks(&ip->i_inode, alloced); |
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 8a102f731003..a86ed6381566 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c | |||
| @@ -725,7 +725,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo) | |||
| 725 | goto fail; | 725 | goto fail; |
| 726 | } | 726 | } |
| 727 | 727 | ||
| 728 | error = -EINVAL; | 728 | error = -EUSERS; |
| 729 | if (!gfs2_jindex_size(sdp)) { | 729 | if (!gfs2_jindex_size(sdp)) { |
| 730 | fs_err(sdp, "no journals!\n"); | 730 | fs_err(sdp, "no journals!\n"); |
| 731 | goto fail_jindex; | 731 | goto fail_jindex; |
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index fa588006588d..237874f1af23 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c | |||
| @@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode) | |||
| 354 | */ | 354 | */ |
| 355 | int nfs_fscache_release_page(struct page *page, gfp_t gfp) | 355 | int nfs_fscache_release_page(struct page *page, gfp_t gfp) |
| 356 | { | 356 | { |
| 357 | struct nfs_inode *nfsi = NFS_I(page->mapping->host); | ||
| 358 | struct fscache_cookie *cookie = nfsi->fscache; | ||
| 359 | |||
| 360 | BUG_ON(!cookie); | ||
| 361 | |||
| 362 | if (PageFsCache(page)) { | 357 | if (PageFsCache(page)) { |
| 358 | struct nfs_inode *nfsi = NFS_I(page->mapping->host); | ||
| 359 | struct fscache_cookie *cookie = nfsi->fscache; | ||
| 360 | |||
| 361 | BUG_ON(!cookie); | ||
| 363 | dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", | 362 | dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n", |
| 364 | cookie, page, nfsi); | 363 | cookie, page, nfsi); |
| 365 | 364 | ||
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index 0adefc40cc89..59047f8d7d72 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
| @@ -120,7 +120,7 @@ static struct { | |||
| 120 | { .status = MNT3ERR_INVAL, .errno = -EINVAL, }, | 120 | { .status = MNT3ERR_INVAL, .errno = -EINVAL, }, |
| 121 | { .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, }, | 121 | { .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, }, |
| 122 | { .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, }, | 122 | { .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, }, |
| 123 | { .status = MNT3ERR_SERVERFAULT, .errno = -ESERVERFAULT, }, | 123 | { .status = MNT3ERR_SERVERFAULT, .errno = -EREMOTEIO, }, |
| 124 | }; | 124 | }; |
| 125 | 125 | ||
| 126 | struct mountres { | 126 | struct mountres { |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 5e078b222b4e..7bc2da8efd4a 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
| @@ -699,7 +699,7 @@ static struct { | |||
| 699 | { NFSERR_BAD_COOKIE, -EBADCOOKIE }, | 699 | { NFSERR_BAD_COOKIE, -EBADCOOKIE }, |
| 700 | { NFSERR_NOTSUPP, -ENOTSUPP }, | 700 | { NFSERR_NOTSUPP, -ENOTSUPP }, |
| 701 | { NFSERR_TOOSMALL, -ETOOSMALL }, | 701 | { NFSERR_TOOSMALL, -ETOOSMALL }, |
| 702 | { NFSERR_SERVERFAULT, -ESERVERFAULT }, | 702 | { NFSERR_SERVERFAULT, -EREMOTEIO }, |
| 703 | { NFSERR_BADTYPE, -EBADTYPE }, | 703 | { NFSERR_BADTYPE, -EBADTYPE }, |
| 704 | { NFSERR_JUKEBOX, -EJUKEBOX }, | 704 | { NFSERR_JUKEBOX, -EJUKEBOX }, |
| 705 | { -1, -EIO } | 705 | { -1, -EIO } |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e437fd6a819f..5cd5184b56db 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -4631,7 +4631,7 @@ static int decode_sequence(struct xdr_stream *xdr, | |||
| 4631 | * If the server returns different values for sessionID, slotID or | 4631 | * If the server returns different values for sessionID, slotID or |
| 4632 | * sequence number, the server is looney tunes. | 4632 | * sequence number, the server is looney tunes. |
| 4633 | */ | 4633 | */ |
| 4634 | status = -ESERVERFAULT; | 4634 | status = -EREMOTEIO; |
| 4635 | 4635 | ||
| 4636 | if (memcmp(id.data, res->sr_session->sess_id.data, | 4636 | if (memcmp(id.data, res->sr_session->sess_id.data, |
| 4637 | NFS4_MAX_SESSIONID_LEN)) { | 4637 | NFS4_MAX_SESSIONID_LEN)) { |
| @@ -5774,7 +5774,7 @@ static struct { | |||
| 5774 | { NFS4ERR_BAD_COOKIE, -EBADCOOKIE }, | 5774 | { NFS4ERR_BAD_COOKIE, -EBADCOOKIE }, |
| 5775 | { NFS4ERR_NOTSUPP, -ENOTSUPP }, | 5775 | { NFS4ERR_NOTSUPP, -ENOTSUPP }, |
| 5776 | { NFS4ERR_TOOSMALL, -ETOOSMALL }, | 5776 | { NFS4ERR_TOOSMALL, -ETOOSMALL }, |
| 5777 | { NFS4ERR_SERVERFAULT, -ESERVERFAULT }, | 5777 | { NFS4ERR_SERVERFAULT, -EREMOTEIO }, |
| 5778 | { NFS4ERR_BADTYPE, -EBADTYPE }, | 5778 | { NFS4ERR_BADTYPE, -EBADTYPE }, |
| 5779 | { NFS4ERR_LOCKED, -EAGAIN }, | 5779 | { NFS4ERR_LOCKED, -EAGAIN }, |
| 5780 | { NFS4ERR_SYMLINK, -ELOOP }, | 5780 | { NFS4ERR_SYMLINK, -ELOOP }, |
| @@ -5801,7 +5801,7 @@ nfs4_stat_to_errno(int stat) | |||
| 5801 | } | 5801 | } |
| 5802 | if (stat <= 10000 || stat > 10100) { | 5802 | if (stat <= 10000 || stat > 10100) { |
| 5803 | /* The server is looney tunes. */ | 5803 | /* The server is looney tunes. */ |
| 5804 | return -ESERVERFAULT; | 5804 | return -EREMOTEIO; |
| 5805 | } | 5805 | } |
| 5806 | /* If we cannot translate the error, the recovery routines should | 5806 | /* If we cannot translate the error, the recovery routines should |
| 5807 | * handle it. | 5807 | * handle it. |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 7b54b8bb101f..d63d964a0392 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
| @@ -1598,8 +1598,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage, | |||
| 1598 | struct nfs_page *req; | 1598 | struct nfs_page *req; |
| 1599 | int ret; | 1599 | int ret; |
| 1600 | 1600 | ||
| 1601 | if (PageFsCache(page)) | 1601 | nfs_fscache_release_page(page, GFP_KERNEL); |
| 1602 | nfs_fscache_release_page(page, GFP_KERNEL); | ||
| 1603 | 1602 | ||
| 1604 | req = nfs_find_and_lock_request(page); | 1603 | req = nfs_find_and_lock_request(page); |
| 1605 | ret = PTR_ERR(req); | 1604 | ret = PTR_ERR(req); |
