]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Dec 2017 12:21:19 +0000 (13:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Dec 2017 12:21:19 +0000 (13:21 +0100)
added patches:
mtd-nand-fix-writing-mtdoops-to-nand-flash.patch
nfs-revalidate-.-etc-correctly-on-open.patch

queue-4.4/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch [new file with mode: 0644]
queue-4.4/nfs-revalidate-.-etc-correctly-on-open.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch b/queue-4.4/mtd-nand-fix-writing-mtdoops-to-nand-flash.patch
new file mode 100644 (file)
index 0000000..25d8fb4
--- /dev/null
@@ -0,0 +1,51 @@
+From 30863e38ebeb500a31cecee8096fb5002677dd9b Mon Sep 17 00:00:00 2001
+From: Brent Taylor <motobud@gmail.com>
+Date: Mon, 30 Oct 2017 22:32:45 -0500
+Subject: mtd: nand: Fix writing mtdoops to nand flash.
+
+From: Brent Taylor <motobud@gmail.com>
+
+commit 30863e38ebeb500a31cecee8096fb5002677dd9b upstream.
+
+When mtdoops calls mtd_panic_write(), it eventually calls
+panic_nand_write() in nand_base.c. In order to properly wait for the
+nand chip to be ready in panic_nand_wait(), the chip must first be
+selected.
+
+When using the atmel nand flash controller, a panic would occur due to
+a NULL pointer exception.
+
+Fixes: 2af7c6539931 ("mtd: Add panic_write for NAND flashes")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Brent Taylor <motobud@gmail.com>
+Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/mtd/nand/nand_base.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/mtd/nand/nand_base.c
++++ b/drivers/mtd/nand/nand_base.c
+@@ -2663,15 +2663,18 @@ static int panic_nand_write(struct mtd_i
+                           size_t *retlen, const uint8_t *buf)
+ {
+       struct nand_chip *chip = mtd->priv;
++      int chipnr = (int)(to >> chip->chip_shift);
+       struct mtd_oob_ops ops;
+       int ret;
+-      /* Wait for the device to get ready */
+-      panic_nand_wait(mtd, chip, 400);
+-
+       /* Grab the device */
+       panic_nand_get_device(chip, mtd, FL_WRITING);
++      chip->select_chip(mtd, chipnr);
++
++      /* Wait for the device to get ready */
++      panic_nand_wait(mtd, chip, 400);
++
+       memset(&ops, 0, sizeof(ops));
+       ops.len = len;
+       ops.datbuf = (uint8_t *)buf;
diff --git a/queue-4.4/nfs-revalidate-.-etc-correctly-on-open.patch b/queue-4.4/nfs-revalidate-.-etc-correctly-on-open.patch
new file mode 100644 (file)
index 0000000..f73cd80
--- /dev/null
@@ -0,0 +1,60 @@
+From b688741cb06695312f18b730653d6611e1bad28d Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.com>
+Date: Fri, 25 Aug 2017 17:34:41 +1000
+Subject: NFS: revalidate "." etc correctly on "open".
+
+From: NeilBrown <neilb@suse.com>
+
+commit b688741cb06695312f18b730653d6611e1bad28d upstream.
+
+For correct close-to-open semantics, NFS must validate
+the change attribute of a directory (or file) on open.
+
+Since commit ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a
+d_weak_revalidate dentry op"), open() of "." or a path ending ".." is
+not revalidated reliably (except when that direct is a mount point).
+
+Prior to that commit, "." was revalidated using nfs_lookup_revalidate()
+which checks the LOOKUP_OPEN flag and forces revalidation if the flag is
+set.
+Since that commit, nfs_weak_revalidate() is used for NFSv3 (which
+ignores the flags) and nothing is used for NFSv4.
+
+This is fixed by using nfs_lookup_verify_inode() in
+nfs_weak_revalidate().  This does the revalidation exactly when needed.
+Also, add a definition of .d_weak_revalidate for NFSv4.
+
+The incorrect behavior is easily demonstrated by running "echo *" in
+some non-mountpoint NFS directory while watching network traffic.
+Without this patch, "echo *" sometimes doesn't produce any traffic.
+With the patch it always does.
+
+Fixes: ecf3d1f1aa74 ("vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op")
+cc: stable@vger.kernel.org (3.9+)
+Signed-off-by: NeilBrown <neilb@suse.com>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/dir.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1260,7 +1260,7 @@ static int nfs_weak_revalidate(struct de
+               return 0;
+       }
+-      error = nfs_revalidate_inode(NFS_SERVER(inode), inode);
++      error = nfs_lookup_verify_inode(inode, flags);
+       dfprintk(LOOKUPCACHE, "NFS: %s: inode %lu is %s\n",
+                       __func__, inode->i_ino, error ? "invalid" : "valid");
+       return !error;
+@@ -1420,6 +1420,7 @@ static int nfs4_lookup_revalidate(struct
+ const struct dentry_operations nfs4_dentry_operations = {
+       .d_revalidate   = nfs4_lookup_revalidate,
++      .d_weak_revalidate      = nfs_weak_revalidate,
+       .d_delete       = nfs_dentry_delete,
+       .d_iput         = nfs_dentry_iput,
+       .d_automount    = nfs_d_automount,
index 77a5c0270eeb04163496c7cb3b725bbc1c975c46..be27457e1da4cade2127c24c050382ac14221b49 100644 (file)
@@ -18,3 +18,5 @@ bcache-fix-building-error-on-mips.patch
 revert-drm-radeon-dont-switch-vt-on-suspend.patch
 drm-radeon-fix-atombios-on-big-endian.patch
 drm-panel-simple-add-missing-panel_simple_unprepare-calls.patch
+mtd-nand-fix-writing-mtdoops-to-nand-flash.patch
+nfs-revalidate-.-etc-correctly-on-open.patch