--- /dev/null
+From 757c4f6260febff982276818bb946df89c1105aa Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton@redhat.com>
+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 <jlayton@redhat.com>
+
+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 <dwm37@cam.ac.uk>
+Cc: "Stefan (metze) Metzmacher" <metze@samba.org>
+Cc: Sachin Prabhu <sprabhu@redhat.com>
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Signed-off-by: Steve French <smfrench@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
--- /dev/null
+From 057d6332b24a4497c55a761c83c823eed9e3f23b Mon Sep 17 00:00:00 2001
+From: Chen Gang <gang.chen@asianux.com>
+Date: Fri, 19 Jul 2013 09:01:36 +0800
+Subject: cifs: extend the buffer length enought for sprintf() using
+
+From: Chen Gang <gang.chen@asianux.com>
+
+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 <gang.chen@asianux.com>
+Reviewed-by: Jeff Layton <jlayton@redhat.com>
+Reviewed-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
+Reviewed-by: Scott Lovenberg <scott.lovenberg@gmail.com>
+Signed-off-by: Steve French <smfrench@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;
--- /dev/null
+From 59d9fa5c2e9086db11aa287bb4030151d0095a17 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Thu, 8 Aug 2013 23:01:24 -0400
+Subject: ext4: allow the mount options nodelalloc and data=journal
+
+From: Theodore Ts'o <tytso@mit.edu>
+
+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 <p.sarna@partner.samsung.com>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 |
--- /dev/null
+From 6ae6514b33f941d3386da0dfbe2942766eab1577 Mon Sep 17 00:00:00 2001
+From: Piotr Sarna <p.sarna@partner.samsung.com>
+Date: Thu, 8 Aug 2013 23:02:24 -0400
+Subject: ext4: fix mount/remount error messages for incompatible mount options
+
+From: Piotr Sarna <p.sarna@partner.samsung.com>
+
+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 <p.sarna@partner.samsung.com>
+Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
+Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
+Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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");
+
--- /dev/null
+From cde2d7a796f7e895e25b43471ed658079345636d Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+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 <tytso@mit.edu>
+
+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" <tytso@mit.edu>
+Cc: Zheng Liu <gnehzuil.liu@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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));
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
--- /dev/null
+From 75c7caf5a052ffd8db3312fa7864ee2d142890c4 Mon Sep 17 00:00:00 2001
+From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+Date: Sat, 22 Jun 2013 17:21:00 +0300
+Subject: zram: allow request end to coincide with disksize
+
+From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
+
+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 <sergey.senozhatsky@gmail.com>
+Cc: Thomas Backlund <tmb@mageia.org>
+Cc: Minchan Kim <minchan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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 */