RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Yue Zhang (OSTC DEV)


> -Original Message-
> From: Greg KH [mailto:g...@kroah.com]
> > From: Yue Zhang 
> >
> > hv_fcopy_daemon fails to overwrite a file if the target file already
> > exits.
> >
> > Add O_TRUNC flag on opening.
> >
> > MS-TFS: 341345
> 
> It's as if the people on your team don't talk to each other about what they
> should, or should not, include in their patch descriptions...
> 
> Please remove.

Sorry for this. It is added by mistake. I will remove it.

Yue Zhang
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Greg KH
On Fri, Jun 27, 2014 at 05:16:48PM -0700, Yue Zhang wrote:
> From: Yue Zhang 
> 
> hv_fcopy_daemon fails to overwrite a file if the target file already
> exits.
> 
> Add O_TRUNC flag on opening.
> 
> MS-TFS: 341345

It's as if the people on your team don't talk to each other about what
they should, or should not, include in their patch descriptions...

Please remove.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread KY Srinivasan


> -Original Message-
> From: Yue Zhang [mailto:yue...@microsoft.com]
> Sent: Friday, June 27, 2014 5:17 PM
> To: KY Srinivasan; Haiyang Zhang; driverdev-de...@linuxdriverproject.org;
> linux-kernel@vger.kernel.org; o...@aepfle.de; jasow...@redhat.com;
> a...@canonical.com
> Cc: Dexuan Cui; Thomas Shao
> Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
> 
> From: Yue Zhang 
> 
> hv_fcopy_daemon fails to overwrite a file if the target file already exits.
> 
> Add O_TRUNC flag on opening.
> 
> MS-TFS: 341345
You need to include Greg in the "to list". Also get rid of the MS-TFS tag.

> 
> Signed-off-by: Yue Zhang 
> ---
>  tools/hv/hv_fcopy_daemon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
> index fba1c75..2a86297 100644
> --- a/tools/hv/hv_fcopy_daemon.c
> +++ b/tools/hv/hv_fcopy_daemon.c
> @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
>   }
>   }
> 
> - target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC,
> 0744);
> + target_fd = open(target_fname,
> + O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC,
> 0744);
Please align properly and there is no need for three lines here.

K. Y
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Yue Zhang
From: Yue Zhang 

hv_fcopy_daemon fails to overwrite a file if the target file already
exits.

Add O_TRUNC flag on opening.

MS-TFS: 341345

Signed-off-by: Yue Zhang 
---
 tools/hv/hv_fcopy_daemon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index fba1c75..2a86297 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
}
}
 
-   target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
+   target_fd = open(target_fname,
+   O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
if (target_fd == -1) {
syslog(LOG_INFO, "Open Failed: %s", strerror(errno));
goto done;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Yue Zhang
From: Yue Zhang yue...@microsoft.com

hv_fcopy_daemon fails to overwrite a file if the target file already
exits.

Add O_TRUNC flag on opening.

MS-TFS: 341345

Signed-off-by: Yue Zhang yue...@microsoft.com
---
 tools/hv/hv_fcopy_daemon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index fba1c75..2a86297 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
}
}
 
-   target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
+   target_fd = open(target_fname,
+   O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
if (target_fd == -1) {
syslog(LOG_INFO, Open Failed: %s, strerror(errno));
goto done;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread KY Srinivasan


 -Original Message-
 From: Yue Zhang [mailto:yue...@microsoft.com]
 Sent: Friday, June 27, 2014 5:17 PM
 To: KY Srinivasan; Haiyang Zhang; driverdev-de...@linuxdriverproject.org;
 linux-kernel@vger.kernel.org; o...@aepfle.de; jasow...@redhat.com;
 a...@canonical.com
 Cc: Dexuan Cui; Thomas Shao
 Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
 
 From: Yue Zhang yue...@microsoft.com
 
 hv_fcopy_daemon fails to overwrite a file if the target file already exits.
 
 Add O_TRUNC flag on opening.
 
 MS-TFS: 341345
You need to include Greg in the to list. Also get rid of the MS-TFS tag.

 
 Signed-off-by: Yue Zhang yue...@microsoft.com
 ---
  tools/hv/hv_fcopy_daemon.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
 index fba1c75..2a86297 100644
 --- a/tools/hv/hv_fcopy_daemon.c
 +++ b/tools/hv/hv_fcopy_daemon.c
 @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
   }
   }
 
 - target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC,
 0744);
 + target_fd = open(target_fname,
 + O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC,
 0744);
Please align properly and there is no need for three lines here.

K. Y
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Greg KH
On Fri, Jun 27, 2014 at 05:16:48PM -0700, Yue Zhang wrote:
 From: Yue Zhang yue...@microsoft.com
 
 hv_fcopy_daemon fails to overwrite a file if the target file already
 exits.
 
 Add O_TRUNC flag on opening.
 
 MS-TFS: 341345

It's as if the people on your team don't talk to each other about what
they should, or should not, include in their patch descriptions...

Please remove.

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-27 Thread Yue Zhang (OSTC DEV)


 -Original Message-
 From: Greg KH [mailto:g...@kroah.com]
  From: Yue Zhang yue...@microsoft.com
 
  hv_fcopy_daemon fails to overwrite a file if the target file already
  exits.
 
  Add O_TRUNC flag on opening.
 
  MS-TFS: 341345
 
 It's as if the people on your team don't talk to each other about what they
 should, or should not, include in their patch descriptions...
 
 Please remove.

Sorry for this. It is added by mistake. I will remove it.

Yue Zhang
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread Yue Zhang (OSTC DEV)


> -Original Message-
> From: KY Srinivasan
> > -Original Message-
> > From: Yue Zhang [mailto:yue...@microsoft.com]
> > hv_fcopy_daemon fails to overwrite a file if the target file already exits.
> >
> > Add O_TRUNC flag on opening.
> >
> > Signed-off-by: Yue Zhang 
> > ---
> >  tools/hv/hv_fcopy_daemon.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
> > index fba1c75..01eee6b 100644
> > --- a/tools/hv/hv_fcopy_daemon.c
> > +++ b/tools/hv/hv_fcopy_daemon.c
> > @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy
> > *smsg)  }  }
> >
> > -target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
> > +target_fd = open(target_fname,
> > +O_RDWR | O_CREAT | O_TRUNC |
> Please align O_RDWR to align with the first argument (target_fname).
Thanks. I will fix it. 
> 
> K. Y
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread KY Srinivasan


> -Original Message-
> From: Yue Zhang [mailto:yue...@microsoft.com]
> Sent: Thursday, June 26, 2014 2:09 PM
> To: KY Srinivasan; Haiyang Zhang; driverdev-de...@linuxdriverproject.org;
> linux-kernel@vger.kernel.org; o...@aepfle.de; jasow...@redhat.com;
> a...@canonical.com
> Cc: Dexuan Cui; Thomas Shao
> Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
> 
> From: Yue Zhang 
> 
> hv_fcopy_daemon fails to overwrite a file if the target file already exits.
> 
> Add O_TRUNC flag on opening.
> 
> Signed-off-by: Yue Zhang 
> ---
>  tools/hv/hv_fcopy_daemon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
> index fba1c75..01eee6b 100644
> --- a/tools/hv/hv_fcopy_daemon.c
> +++ b/tools/hv/hv_fcopy_daemon.c
> @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
>   }
>   }
> 
> - target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC,
> 0744);
> + target_fd = open(target_fname,
> + O_RDWR | O_CREAT | O_TRUNC |
Please align O_RDWR to align with the first argument (target_fname). 

K. Y

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread Yue Zhang
From: Yue Zhang 

hv_fcopy_daemon fails to overwrite a file if the target file already
exits.

Add O_TRUNC flag on opening.

Signed-off-by: Yue Zhang 
---
 tools/hv/hv_fcopy_daemon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index fba1c75..01eee6b 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
}
}
 
-   target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
+   target_fd = open(target_fname,
+   O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
if (target_fd == -1) {
syslog(LOG_INFO, "Open Failed: %s", strerror(errno));
goto done;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread Yue Zhang
From: Yue Zhang yue...@microsoft.com

hv_fcopy_daemon fails to overwrite a file if the target file already
exits.

Add O_TRUNC flag on opening.

Signed-off-by: Yue Zhang yue...@microsoft.com
---
 tools/hv/hv_fcopy_daemon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index fba1c75..01eee6b 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
}
}
 
-   target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
+   target_fd = open(target_fname,
+   O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0744);
if (target_fd == -1) {
syslog(LOG_INFO, Open Failed: %s, strerror(errno));
goto done;
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread KY Srinivasan


 -Original Message-
 From: Yue Zhang [mailto:yue...@microsoft.com]
 Sent: Thursday, June 26, 2014 2:09 PM
 To: KY Srinivasan; Haiyang Zhang; driverdev-de...@linuxdriverproject.org;
 linux-kernel@vger.kernel.org; o...@aepfle.de; jasow...@redhat.com;
 a...@canonical.com
 Cc: Dexuan Cui; Thomas Shao
 Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
 
 From: Yue Zhang yue...@microsoft.com
 
 hv_fcopy_daemon fails to overwrite a file if the target file already exits.
 
 Add O_TRUNC flag on opening.
 
 Signed-off-by: Yue Zhang yue...@microsoft.com
 ---
  tools/hv/hv_fcopy_daemon.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
 index fba1c75..01eee6b 100644
 --- a/tools/hv/hv_fcopy_daemon.c
 +++ b/tools/hv/hv_fcopy_daemon.c
 @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy *smsg)
   }
   }
 
 - target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC,
 0744);
 + target_fd = open(target_fname,
 + O_RDWR | O_CREAT | O_TRUNC |
Please align O_RDWR to align with the first argument (target_fname). 

K. Y

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon

2014-06-26 Thread Yue Zhang (OSTC DEV)


 -Original Message-
 From: KY Srinivasan
  -Original Message-
  From: Yue Zhang [mailto:yue...@microsoft.com]
  hv_fcopy_daemon fails to overwrite a file if the target file already exits.
 
  Add O_TRUNC flag on opening.
 
  Signed-off-by: Yue Zhang yue...@microsoft.com
  ---
   tools/hv/hv_fcopy_daemon.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)
 
  diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
  index fba1c75..01eee6b 100644
  --- a/tools/hv/hv_fcopy_daemon.c
  +++ b/tools/hv/hv_fcopy_daemon.c
  @@ -88,7 +88,8 @@ static int hv_start_fcopy(struct hv_start_fcopy
  *smsg)  }  }
 
  -target_fd = open(target_fname, O_RDWR | O_CREAT | O_CLOEXEC, 0744);
  +target_fd = open(target_fname,
  +O_RDWR | O_CREAT | O_TRUNC |
 Please align O_RDWR to align with the first argument (target_fname).
Thanks. I will fix it. 
 
 K. Y
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/