From: Greg Kroah-Hartman Date: Tue, 13 Aug 2013 05:47:10 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.0.91~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce5f74942e21dba4d4f4a0276501efe672f5b1c0;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: cifs-don-t-instantiate-new-dentries-in-readdir-for-inodes-that-need-to-be-revalidated-immediately.patch cifs-extend-the-buffer-length-enought-for-sprintf-using.patch ext4-allow-the-mount-options-nodelalloc-and-data-journal.patch ext4-fix-mount-remount-error-messages-for-incompatible-mount-options.patch ext4-flush-the-extent-status-cache-during-ext4_ioc_swap_boot.patch zram-allow-request-end-to-coincide-with-disksize.patch --- diff --git a/queue-3.10/cifs-don-t-instantiate-new-dentries-in-readdir-for-inodes-that-need-to-be-revalidated-immediately.patch b/queue-3.10/cifs-don-t-instantiate-new-dentries-in-readdir-for-inodes-that-need-to-be-revalidated-immediately.patch new file mode 100644 index 00000000000..6440296f54e --- /dev/null +++ b/queue-3.10/cifs-don-t-instantiate-new-dentries-in-readdir-for-inodes-that-need-to-be-revalidated-immediately.patch @@ -0,0 +1,48 @@ +From 757c4f6260febff982276818bb946df89c1105aa Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Wed, 7 Aug 2013 10:29:08 -0400 +Subject: cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately + +From: Jeff Layton + +commit 757c4f6260febff982276818bb946df89c1105aa upstream. + +David reported that commit c2b93e06 (cifs: only set ops for inodes in +I_NEW state) caused a regression with mfsymlinks. Prior to that patch, +if a mfsymlink dentry was instantiated at readdir time, the inode would +get a new set of ops when it was revalidated. After that patch, this +did not occur. + +This patch addresses this by simply skipping instantiating dentries in +the readdir codepath when we know that they will need to be immediately +revalidated. The next attempt to use that dentry will cause a new lookup +to occur (which is basically what we want to happen anyway). + +Reported-and-Tested-by: David McBride +Cc: "Stefan (metze) Metzmacher" +Cc: Sachin Prabhu +Signed-off-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/readdir.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/fs/cifs/readdir.c ++++ b/fs/cifs/readdir.c +@@ -111,6 +111,14 @@ cifs_prime_dcache(struct dentry *parent, + return; + } + ++ /* ++ * If we know that the inode will need to be revalidated immediately, ++ * then don't create a new dentry for it. We'll end up doing an on ++ * the wire call either way and this spares us an invalidation. ++ */ ++ if (fattr->cf_flags & CIFS_FATTR_NEED_REVAL) ++ return; ++ + dentry = d_alloc(parent, name); + if (!dentry) + return; diff --git a/queue-3.10/cifs-extend-the-buffer-length-enought-for-sprintf-using.patch b/queue-3.10/cifs-extend-the-buffer-length-enought-for-sprintf-using.patch new file mode 100644 index 00000000000..766ec8c3775 --- /dev/null +++ b/queue-3.10/cifs-extend-the-buffer-length-enought-for-sprintf-using.patch @@ -0,0 +1,99 @@ +From 057d6332b24a4497c55a761c83c823eed9e3f23b Mon Sep 17 00:00:00 2001 +From: Chen Gang +Date: Fri, 19 Jul 2013 09:01:36 +0800 +Subject: cifs: extend the buffer length enought for sprintf() using + +From: Chen Gang + +commit 057d6332b24a4497c55a761c83c823eed9e3f23b upstream. + +For cifs_set_cifscreds() in "fs/cifs/connect.c", 'desc' buffer length +is 'CIFSCREDS_DESC_SIZE' (56 is less than 256), and 'ses->domainName' +length may be "255 + '\0'". + +The related sprintf() may cause memory overflow, so need extend related +buffer enough to hold all things. + +It is also necessary to be sure of 'ses->domainName' must be less than +256, and define the related macro instead of hard code number '256'. + +Signed-off-by: Chen Gang +Reviewed-by: Jeff Layton +Reviewed-by: Shirish Pargaonkar +Reviewed-by: Scott Lovenberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/cifsencrypt.c | 2 +- + fs/cifs/cifsglob.h | 1 + + fs/cifs/connect.c | 7 ++++--- + fs/cifs/sess.c | 6 +++--- + 4 files changed, 9 insertions(+), 7 deletions(-) + +--- a/fs/cifs/cifsencrypt.c ++++ b/fs/cifs/cifsencrypt.c +@@ -389,7 +389,7 @@ find_domain_name(struct cifs_ses *ses, c + if (blobptr + attrsize > blobend) + break; + if (type == NTLMSSP_AV_NB_DOMAIN_NAME) { +- if (!attrsize) ++ if (!attrsize || attrsize >= CIFS_MAX_DOMAINNAME_LEN) + break; + if (!ses->domainName) { + ses->domainName = +--- a/fs/cifs/cifsglob.h ++++ b/fs/cifs/cifsglob.h +@@ -44,6 +44,7 @@ + #define MAX_TREE_SIZE (2 + MAX_SERVER_SIZE + 1 + MAX_SHARE_SIZE + 1) + #define MAX_SERVER_SIZE 15 + #define MAX_SHARE_SIZE 80 ++#define CIFS_MAX_DOMAINNAME_LEN 256 /* max domain name length */ + #define MAX_USERNAME_SIZE 256 /* reasonable maximum for current servers */ + #define MAX_PASSWORD_SIZE 512 /* max for windows seems to be 256 wide chars */ + +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -1662,7 +1662,8 @@ cifs_parse_mount_options(const char *mou + if (string == NULL) + goto out_nomem; + +- if (strnlen(string, 256) == 256) { ++ if (strnlen(string, CIFS_MAX_DOMAINNAME_LEN) ++ == CIFS_MAX_DOMAINNAME_LEN) { + printk(KERN_WARNING "CIFS: domain name too" + " long\n"); + goto cifs_parse_mount_err; +@@ -2288,8 +2289,8 @@ cifs_put_smb_ses(struct cifs_ses *ses) + + #ifdef CONFIG_KEYS + +-/* strlen("cifs:a:") + INET6_ADDRSTRLEN + 1 */ +-#define CIFSCREDS_DESC_SIZE (7 + INET6_ADDRSTRLEN + 1) ++/* strlen("cifs:a:") + CIFS_MAX_DOMAINNAME_LEN + 1 */ ++#define CIFSCREDS_DESC_SIZE (7 + CIFS_MAX_DOMAINNAME_LEN + 1) + + /* Populate username and pw fields from keyring if possible */ + static int +--- a/fs/cifs/sess.c ++++ b/fs/cifs/sess.c +@@ -198,7 +198,7 @@ static void unicode_domain_string(char * + bytes_ret = 0; + } else + bytes_ret = cifs_strtoUTF16((__le16 *) bcc_ptr, ses->domainName, +- 256, nls_cp); ++ CIFS_MAX_DOMAINNAME_LEN, nls_cp); + bcc_ptr += 2 * bytes_ret; + bcc_ptr += 2; /* account for null terminator */ + +@@ -256,8 +256,8 @@ static void ascii_ssetup_strings(char ** + + /* copy domain */ + if (ses->domainName != NULL) { +- strncpy(bcc_ptr, ses->domainName, 256); +- bcc_ptr += strnlen(ses->domainName, 256); ++ strncpy(bcc_ptr, ses->domainName, CIFS_MAX_DOMAINNAME_LEN); ++ bcc_ptr += strnlen(ses->domainName, CIFS_MAX_DOMAINNAME_LEN); + } /* else we will send a null domain name + so the server will default to its own domain */ + *bcc_ptr = 0; diff --git a/queue-3.10/ext4-allow-the-mount-options-nodelalloc-and-data-journal.patch b/queue-3.10/ext4-allow-the-mount-options-nodelalloc-and-data-journal.patch new file mode 100644 index 00000000000..19d619dc727 --- /dev/null +++ b/queue-3.10/ext4-allow-the-mount-options-nodelalloc-and-data-journal.patch @@ -0,0 +1,34 @@ +From 59d9fa5c2e9086db11aa287bb4030151d0095a17 Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Thu, 8 Aug 2013 23:01:24 -0400 +Subject: ext4: allow the mount options nodelalloc and data=journal + +From: Theodore Ts'o + +commit 59d9fa5c2e9086db11aa287bb4030151d0095a17 upstream. + +Commit 26092bf ("ext4: use a table-driven handler for mount options") +wrongly disallows the specifying the mount options nodelalloc and +data=journal simultaneously. This is incorrect; it should have only +disallowed the combination of delalloc and data=journal +simultaneously. + +Reported-by: Piotr Sarna +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -1341,7 +1341,7 @@ static const struct mount_opts { + {Opt_delalloc, EXT4_MOUNT_DELALLOC, + MOPT_EXT4_ONLY | MOPT_SET | MOPT_EXPLICIT}, + {Opt_nodelalloc, EXT4_MOUNT_DELALLOC, +- MOPT_EXT4_ONLY | MOPT_CLEAR | MOPT_EXPLICIT}, ++ MOPT_EXT4_ONLY | MOPT_CLEAR}, + {Opt_journal_checksum, EXT4_MOUNT_JOURNAL_CHECKSUM, + MOPT_EXT4_ONLY | MOPT_SET}, + {Opt_journal_async_commit, (EXT4_MOUNT_JOURNAL_ASYNC_COMMIT | diff --git a/queue-3.10/ext4-fix-mount-remount-error-messages-for-incompatible-mount-options.patch b/queue-3.10/ext4-fix-mount-remount-error-messages-for-incompatible-mount-options.patch new file mode 100644 index 00000000000..a8e62d0fc49 --- /dev/null +++ b/queue-3.10/ext4-fix-mount-remount-error-messages-for-incompatible-mount-options.patch @@ -0,0 +1,68 @@ +From 6ae6514b33f941d3386da0dfbe2942766eab1577 Mon Sep 17 00:00:00 2001 +From: Piotr Sarna +Date: Thu, 8 Aug 2013 23:02:24 -0400 +Subject: ext4: fix mount/remount error messages for incompatible mount options + +From: Piotr Sarna + +commit 6ae6514b33f941d3386da0dfbe2942766eab1577 upstream. + +Commit 5688978 ("ext4: improve handling of conflicting mount options") +introduced incorrect messages shown while choosing wrong mount options. + +First of all, both cases of incorrect mount options, +"data=journal,delalloc" and "data=journal,dioread_nolock" result in +the same error message. + +Secondly, the problem above isn't solved for remount option: the +mismatched parameter is simply ignored. Moreover, ext4_msg states +that remount with options "data=journal,delalloc" succeeded, which is +not true. + +To fix it up, I added a simple check after parse_options() call to +ensure that data=journal and delalloc/dioread_nolock parameters are +not present at the same time. + +Signed-off-by: Piotr Sarna +Acked-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Kyungmin Park +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/super.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -3445,7 +3445,7 @@ static int ext4_fill_super(struct super_ + } + if (test_opt(sb, DIOREAD_NOLOCK)) { + ext4_msg(sb, KERN_ERR, "can't mount with " +- "both data=journal and delalloc"); ++ "both data=journal and dioread_nolock"); + goto failed_mount; + } + if (test_opt(sb, DELALLOC)) +@@ -4646,6 +4646,21 @@ static int ext4_remount(struct super_blo + goto restore_opts; + } + ++ if (test_opt(sb, DATA_FLAGS) == EXT4_MOUNT_JOURNAL_DATA) { ++ if (test_opt2(sb, EXPLICIT_DELALLOC)) { ++ ext4_msg(sb, KERN_ERR, "can't mount with " ++ "both data=journal and delalloc"); ++ err = -EINVAL; ++ goto restore_opts; ++ } ++ if (test_opt(sb, DIOREAD_NOLOCK)) { ++ ext4_msg(sb, KERN_ERR, "can't mount with " ++ "both data=journal and dioread_nolock"); ++ err = -EINVAL; ++ goto restore_opts; ++ } ++ } ++ + if (sbi->s_mount_flags & EXT4_MF_FS_ABORTED) + ext4_abort(sb, "Abort forced by user"); + diff --git a/queue-3.10/ext4-flush-the-extent-status-cache-during-ext4_ioc_swap_boot.patch b/queue-3.10/ext4-flush-the-extent-status-cache-during-ext4_ioc_swap_boot.patch new file mode 100644 index 00000000000..a7531568a69 --- /dev/null +++ b/queue-3.10/ext4-flush-the-extent-status-cache-during-ext4_ioc_swap_boot.patch @@ -0,0 +1,37 @@ +From cde2d7a796f7e895e25b43471ed658079345636d Mon Sep 17 00:00:00 2001 +From: Theodore Ts'o +Date: Mon, 12 Aug 2013 09:29:30 -0400 +Subject: ext4: flush the extent status cache during EXT4_IOC_SWAP_BOOT + +From: Theodore Ts'o + +commit cde2d7a796f7e895e25b43471ed658079345636d upstream. + +Previously we weren't swapping only some of the extent_status LRU +fields during the processing of the EXT4_IOC_SWAP_BOOT ioctl. The +much safer thing to do is to just completely flush the extent status +tree when doing the swap. + +Signed-off-by: "Theodore Ts'o" +Cc: Zheng Liu +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/ioctl.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/fs/ext4/ioctl.c ++++ b/fs/ext4/ioctl.c +@@ -77,8 +77,10 @@ static void swap_inode_data(struct inode + memswap(ei1->i_data, ei2->i_data, sizeof(ei1->i_data)); + memswap(&ei1->i_flags, &ei2->i_flags, sizeof(ei1->i_flags)); + memswap(&ei1->i_disksize, &ei2->i_disksize, sizeof(ei1->i_disksize)); +- memswap(&ei1->i_es_tree, &ei2->i_es_tree, sizeof(ei1->i_es_tree)); +- memswap(&ei1->i_es_lru_nr, &ei2->i_es_lru_nr, sizeof(ei1->i_es_lru_nr)); ++ ext4_es_remove_extent(inode1, 0, EXT_MAX_BLOCKS); ++ ext4_es_remove_extent(inode2, 0, EXT_MAX_BLOCKS); ++ ext4_es_lru_del(inode1); ++ ext4_es_lru_del(inode2); + + isize = i_size_read(inode1); + i_size_write(inode1, i_size_read(inode2)); diff --git a/queue-3.10/series b/queue-3.10/series index facb252ce09..023f18586e0 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -42,3 +42,9 @@ drm-ast-invalidate-page-tables-when-pinning-a-bo.patch drm-don-t-pass-negative-delta-to-ktime_sub_ns.patch drm-radeon-select-audio-dto-based-on-encoder-id-for-dce3.patch drm-radeon-stop-sending-invalid-uvd-destroy-msg.patch +ext4-allow-the-mount-options-nodelalloc-and-data-journal.patch +ext4-fix-mount-remount-error-messages-for-incompatible-mount-options.patch +ext4-flush-the-extent-status-cache-during-ext4_ioc_swap_boot.patch +cifs-extend-the-buffer-length-enought-for-sprintf-using.patch +cifs-don-t-instantiate-new-dentries-in-readdir-for-inodes-that-need-to-be-revalidated-immediately.patch +zram-allow-request-end-to-coincide-with-disksize.patch diff --git a/queue-3.10/zram-allow-request-end-to-coincide-with-disksize.patch b/queue-3.10/zram-allow-request-end-to-coincide-with-disksize.patch new file mode 100644 index 00000000000..d7590106c22 --- /dev/null +++ b/queue-3.10/zram-allow-request-end-to-coincide-with-disksize.patch @@ -0,0 +1,37 @@ +From 75c7caf5a052ffd8db3312fa7864ee2d142890c4 Mon Sep 17 00:00:00 2001 +From: Sergey Senozhatsky +Date: Sat, 22 Jun 2013 17:21:00 +0300 +Subject: zram: allow request end to coincide with disksize + +From: Sergey Senozhatsky + +commit 75c7caf5a052ffd8db3312fa7864ee2d142890c4 upstream. + +Pass valid_io_request() checks if request end coincides with disksize +(end equals bound), only fail if we attempt to read beyond the bound. + +mkfs.ext2 produces numerous errors: +[ 2164.632747] quiet_error: 1 callbacks suppressed +[ 2164.633260] Buffer I/O error on device zram0, logical block 153599 +[ 2164.633265] lost page write due to I/O error on zram0 + +Signed-off-by: Sergey Senozhatsky +Cc: Thomas Backlund +Cc: Minchan Kim +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/zram/zram_drv.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/zram/zram_drv.c ++++ b/drivers/staging/zram/zram_drv.c +@@ -432,7 +432,7 @@ static inline int valid_io_request(struc + end = start + (bio->bi_size >> SECTOR_SHIFT); + bound = zram->disksize >> SECTOR_SHIFT; + /* out of range range */ +- if (unlikely(start >= bound || end >= bound || start > end)) ++ if (unlikely(start >= bound || end > bound || start > end)) + return 0; + + /* I/O request is valid */