* [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
@ 2014-06-26 21:09 Yue Zhang
2014-06-26 20:43 ` KY Srinivasan
0 siblings, 1 reply; 7+ messages in thread
From: Yue Zhang @ 2014-06-26 21:09 UTC (permalink / raw)
To: kys, haiyangz, driverdev-devel, linux-kernel, olaf, jasowang, apw
Cc: decui, huishao
From: Yue Zhang <yuezha@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 <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
2014-06-26 21:09 [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon Yue Zhang
@ 2014-06-26 20:43 ` KY Srinivasan
2014-06-26 20:58 ` Yue Zhang (OSTC DEV)
0 siblings, 1 reply; 7+ messages in thread
From: KY Srinivasan @ 2014-06-26 20:43 UTC (permalink / raw)
To: Yue Zhang (OSTC DEV),
Haiyang Zhang, driverdev-devel, linux-kernel, olaf, jasowang,
apw
Cc: Dexuan Cui, Thomas Shao
> -----Original Message-----
> From: Yue Zhang [mailto:yuezha@microsoft.com]
> Sent: Thursday, June 26, 2014 2:09 PM
> To: KY Srinivasan; Haiyang Zhang; driverdev-devel@linuxdriverproject.org;
> linux-kernel@vger.kernel.org; olaf@aepfle.de; jasowang@redhat.com;
> apw@canonical.com
> Cc: Dexuan Cui; Thomas Shao
> Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
>
> From: Yue Zhang <yuezha@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 <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
2014-06-26 20:43 ` KY Srinivasan
@ 2014-06-26 20:58 ` Yue Zhang (OSTC DEV)
0 siblings, 0 replies; 7+ messages in thread
From: Yue Zhang (OSTC DEV) @ 2014-06-26 20:58 UTC (permalink / raw)
To: KY Srinivasan, Haiyang Zhang, driverdev-devel, linux-kernel,
olaf, jasowang, apw
Cc: Dexuan Cui, Thomas Shao
> -----Original Message-----
> From: KY Srinivasan
> > -----Original Message-----
> > From: Yue Zhang [mailto:yuezha@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 <yuezha@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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
@ 2014-06-28 0:16 Yue Zhang
2014-06-27 23:20 ` KY Srinivasan
2014-06-27 23:45 ` Greg KH
0 siblings, 2 replies; 7+ messages in thread
From: Yue Zhang @ 2014-06-28 0:16 UTC (permalink / raw)
To: kys, haiyangz, driverdev-devel, linux-kernel, olaf, jasowang, apw
Cc: decui, huishao
From: Yue Zhang <yuezha@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 <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread* RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
2014-06-28 0:16 Yue Zhang
@ 2014-06-27 23:20 ` KY Srinivasan
2014-06-27 23:45 ` Greg KH
1 sibling, 0 replies; 7+ messages in thread
From: KY Srinivasan @ 2014-06-27 23:20 UTC (permalink / raw)
To: Yue Zhang (OSTC DEV),
Haiyang Zhang, driverdev-devel, linux-kernel, olaf, jasowang,
apw
Cc: Dexuan Cui, Thomas Shao
> -----Original Message-----
> From: Yue Zhang [mailto:yuezha@microsoft.com]
> Sent: Friday, June 27, 2014 5:17 PM
> To: KY Srinivasan; Haiyang Zhang; driverdev-devel@linuxdriverproject.org;
> linux-kernel@vger.kernel.org; olaf@aepfle.de; jasowang@redhat.com;
> apw@canonical.com
> Cc: Dexuan Cui; Thomas Shao
> Subject: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
>
> From: Yue Zhang <yuezha@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 <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
2014-06-28 0:16 Yue Zhang
2014-06-27 23:20 ` KY Srinivasan
@ 2014-06-27 23:45 ` Greg KH
2014-06-27 23:45 ` Yue Zhang (OSTC DEV)
1 sibling, 1 reply; 7+ messages in thread
From: Greg KH @ 2014-06-27 23:45 UTC (permalink / raw)
To: Yue Zhang
Cc: kys, haiyangz, driverdev-devel, linux-kernel, olaf, jasowang,
apw, huishao
On Fri, Jun 27, 2014 at 05:16:48PM -0700, Yue Zhang wrote:
> From: Yue Zhang <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon
2014-06-27 23:45 ` Greg KH
@ 2014-06-27 23:45 ` Yue Zhang (OSTC DEV)
0 siblings, 0 replies; 7+ messages in thread
From: Yue Zhang (OSTC DEV) @ 2014-06-27 23:45 UTC (permalink / raw)
To: Greg KH
Cc: KY Srinivasan, Haiyang Zhang, driverdev-devel, linux-kernel,
olaf, jasowang, apw, Thomas Shao
> -----Original Message-----
> From: Greg KH [mailto:greg@kroah.com]
> > From: Yue Zhang <yuezha@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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-06-27 23:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-26 21:09 [PATCH] Tools: hv: fix file overwriting of hv_fcopy_daemon Yue Zhang
2014-06-26 20:43 ` KY Srinivasan
2014-06-26 20:58 ` Yue Zhang (OSTC DEV)
2014-06-28 0:16 Yue Zhang
2014-06-27 23:20 ` KY Srinivasan
2014-06-27 23:45 ` Greg KH
2014-06-27 23:45 ` Yue Zhang (OSTC DEV)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®