2017-06-25 19:48:17

by kys

[permalink] [raw]
Subject: [PATCH 0/2] Drivers: hv: Miscellaneous fixes

From: K. Y. Srinivasan <[email protected]>

Miscellaneous fixes.

Alex Ng (1):
Tools: hv: vss: Skip freezing filesystems backed by loop

Stephen Hemminger (1):
vmbus: re-enable channel tasklet

drivers/hv/channel.c | 2 ++
tools/hv/hv_vss_daemon.c | 7 +++++++
2 files changed, 9 insertions(+), 0 deletions(-)


2017-06-25 19:48:51

by kys

[permalink] [raw]
Subject: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

From: Alex Ng <[email protected]>

Skip loop devices from the freeze/thaw operation.

Signed-off-by: Alex Ng <[email protected]>
Signed-off-by: Vyronas Tsingaras <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>
---
tools/hv/hv_vss_daemon.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/hv/hv_vss_daemon.c b/tools/hv/hv_vss_daemon.c
index 7ba5419..b2b4ebf 100644
--- a/tools/hv/hv_vss_daemon.c
+++ b/tools/hv/hv_vss_daemon.c
@@ -21,6 +21,7 @@
#include <sys/types.h>
#include <sys/poll.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <mntent.h>
@@ -30,6 +31,7 @@
#include <ctype.h>
#include <errno.h>
#include <linux/fs.h>
+#include <linux/major.h>
#include <linux/hyperv.h>
#include <syslog.h>
#include <getopt.h>
@@ -70,6 +72,7 @@ static int vss_operate(int operation)
char match[] = "/dev/";
FILE *mounts;
struct mntent *ent;
+ struct stat sb;
char errdir[1024] = {0};
unsigned int cmd;
int error = 0, root_seen = 0, save_errno = 0;
@@ -92,6 +95,10 @@ static int vss_operate(int operation)
while ((ent = getmntent(mounts))) {
if (strncmp(ent->mnt_fsname, match, strlen(match)))
continue;
+ if (stat(ent->mnt_fsname, &sb) == -1)
+ continue;
+ if (S_ISBLK(sb.st_mode) && major(sb.st_rdev) == LOOP_MAJOR)
+ continue;
if (hasmntopt(ent, MNTOPT_RO) != NULL)
continue;
if (strcmp(ent->mnt_type, "vfat") == 0)
--
1.7.1

2017-06-25 19:48:50

by kys

[permalink] [raw]
Subject: [PATCH 2/2] vmbus: re-enable channel tasklet

From: Stephen Hemminger <[email protected]>

This problem shows up in 4.11 when netvsc driver is removed and reloaded.
The problem is that the channel is closed during module removal and the
tasklet for processing responses is disabled. When module is reloaded
the channel is reopened but the tasklet is marked as disabled.
The fix is to re-enable tasklet at the end of close which gets it back
to the initial state.

The issue is less urgent in 4.12 since network driver now uses NAPI
and not the tasklet; and other VMBUS devices are rarely unloaded/reloaded.

Fixes: dad72a1d2844 ("vmbus: remove hv_event_tasklet_disable/enable")

Signed-off-by: Stephen Hemminger <[email protected]>
Signed-off-by: K. Y. Srinivasan <[email protected]>
Cc: [email protected]
---
drivers/hv/channel.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c
index e9bf0bb..e57cc40 100644
--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -606,6 +606,8 @@ static int vmbus_close_internal(struct vmbus_channel *channel)
get_order(channel->ringbuffer_pagecount * PAGE_SIZE));

out:
+ /* re-enable tasklet for use on re-open */
+ tasklet_enable(&channel->callback_event);
return ret;
}

--
1.7.1

2017-07-17 13:00:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

On Sun, Jun 25, 2017 at 12:47:45PM -0700, [email protected] wrote:
> From: Alex Ng <[email protected]>
>
> Skip loop devices from the freeze/thaw operation.

Ok, but why? What is the consequences of this? Please provide a much
better changelog comment, especially for something that is supposed to
be a "fix".

thanks,

greg k-h

2017-07-17 18:59:38

by Alex Ng (LIS)

[permalink] [raw]
Subject: RE: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop

My apologies. The changelog comment should be more descriptive.

Since a loop device is backed by a file, a backup will already result in
its parent filesystem being frozen. It's sufficient to just freeze the
parent filesystem, so we can skip the loop device.

This avoids a situation where a loop device and its parent filesystem are
both frozen and then thawed out of order. For example, if the loop device
is enumerated first, we would thaw it while its parent filesystem is still
frozen. The thaw operation fails and the loop device remains frozen.

I'll work with KY to send an updated patch with a better comment.

> -----Original Message-----
> From: Greg KH [mailto:[email protected]]
> Sent: Monday, July 17, 2017 6:00 AM
> To: KY Srinivasan <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; Stephen Hemminger
> <[email protected]>; Alex Ng (LIS) <[email protected]>;
> Vyronas Tsingaras <[email protected]>
> Subject: Re: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by
> loop
>
> On Sun, Jun 25, 2017 at 12:47:45PM -0700, [email protected]
> wrote:
> > From: Alex Ng <[email protected]>
> >
> > Skip loop devices from the freeze/thaw operation.
>
> Ok, but why? What is the consequences of this? Please provide a much
> better changelog comment, especially for something that is supposed to
> be a "fix".
>
> thanks,
>
> greg k-h