cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately

BugLink: http://bugs.launchpad.net/bugs/1222442

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).

Cc: <stable@vger.kernel.org>
Cc: "Stefan (metze) Metzmacher" <metze@samba.org>
Cc: Sachin Prabhu <sprabhu@redhat.com>
Reported-and-Tested-by: David McBride <dwm37@cam.ac.uk>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
(back ported from commit 757c4f6260febff982276818bb946df89c1105aa)
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Revert "zram: use zram->lock to protect zram_free_page() in swap free notify path"

BugLink: http://bugs.launchpad.net/bugs/1215513

This reverts commit f7c24073403a8d28064542b8e1e41424f90319a3, which was
commit 57ab048532c0d975538cebd4456491b5c34248f4 upstream.

This has been found to cause system lock ups when under high memory
pressure.

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
UBUNTU: Ubuntu-3.2.0-54.82

Signed-off-by: Steve Conklin <sconklin@canonical.com>
inetpeer: Invalidate the inetpeer tree along with the routing cache

BugLink: http://bugs.launchpad.net/bugs/1205741

We initialize the routing metrics with the values cached on the
inetpeer in rt_init_metrics(). So if we have the metrics cached on the
inetpeer, we ignore the user configured fib_metrics.

To fix this issue, we replace the old tree with a fresh initialized
inet_peer_base. The old tree is removed later with a delayed work queue.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry picked from commit 5faa5df1fa2024bd750089ff21dcc4191798263d)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
inetpeer: fix a race in inetpeer_gc_worker()

BugLink: http://bugs.launchpad.net/bugs/1205741

commit 5faa5df1fa2024 (inetpeer: Invalidate the inetpeer tree along with
the routing cache) added a race :

Before freeing an inetpeer, we must respect a RCU grace period, and make
sure no user will attempt to increase refcnt.

inetpeer_invalidate_tree() waits for a RCU grace period before inserting
inetpeer tree into gc_list and waking the worker. At that time, no
concurrent lookup can find a inetpeer in this tree.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

(cherry picked from commit 55432d2b543a4b6dfae54f5c432a566877a85d90)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>