Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbdFYTsv (ORCPT ); Sun, 25 Jun 2017 15:48:51 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:33690 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751346AbdFYTss (ORCPT ); Sun, 25 Jun 2017 15:48:48 -0400 x-originating-ip: 107.180.71.197 From: kys@exchange.microsoft.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, olaf@aepfle.de, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, leann.ogasawara@canonical.com, marcelo.cerri@canonical.com, sthemmin@microsoft.com Cc: Alex Ng , Vyronas Tsingaras , "K. Y. Srinivasan" Subject: [PATCH 1/2] Tools: hv: vss: Skip freezing filesystems backed by loop Date: Sun, 25 Jun 2017 12:47:45 -0700 Message-Id: <1498420066-5000-1-git-send-email-kys@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498420033-4914-1-git-send-email-kys@exchange.microsoft.com> References: <1498420033-4914-1-git-send-email-kys@exchange.microsoft.com> Reply-To: kys@microsoft.com X-CMAE-Envelope: MS4wfF/ZklKPB8K1bOsdh3/e0RYx/5raOd0vnbpH+BVqVZ/a/mH7rG+71YUFnXVKS6q2xeyVFChWM7rVS7csCMOKHr5CF4uHrEFdNJrBYRP3hvIIBxVF4/DK hnXOrOp7WapWYgxMnqiafENe4gVq5nxK9yI8f55CL8Ww3YHPVc26/2w1vVEVHY2Fn0CUtm049seeohitkU2nfLwSUv+kf7il243c5XD1wz9pJk7fDax/J6uf HNLN6l+TKQ60PHBc5Q4CkhBuaUx+hVuEcfFz26hsB7eEVTvuQlp9KBHo3Fen+Bzhn7LFw93tRFUDfu+x5i7wYVfGCBknkbwShxcUiNQOr3MGxypXlCNrBwbb F+c6z0pGAEQZQ9ghd4/i3diTJUnBPYGI8Frnr6CLwwvUaLNnLYrCRXTveicLONuJ7mhMiLstMxMDYUEwObFXfatRSin8ZEWmEYLe6245N/6gF9zvFwIMZajK wZfsXcB3pS9BuJKLY8/VJ0u+dGNlnjLJawSCDlDye3SKngR0F/OnYyz7vrQ7oEHPKeYmIUEe9QlhCuFWejvtnATSD0LQrTiwwIBwqEYdK2G/MbKIQkMSgSPx S2Udui9oXF5+yHSgqNqqfZOi Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 52 From: Alex Ng Skip loop devices from the freeze/thaw operation. Signed-off-by: Alex Ng Signed-off-by: Vyronas Tsingaras Signed-off-by: K. Y. Srinivasan --- 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 #include #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -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