diff options
author | Volker Lendecke <vl@samba.org> | 2010-07-29 17:04:18 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-07-29 22:46:36 +0200 |
commit | fec8505e0be067a09929216cfe476802f21d14fe (patch) | |
tree | 43c1187436fcb8a46464d1b24e30fac38917f187 | |
parent | 4f4303048260ca19a5feef6b9338add1a19fb53c (diff) | |
download | samba-fec8505e0be067a09929216cfe476802f21d14fe.tar.gz samba-fec8505e0be067a09929216cfe476802f21d14fe.tar.bz2 samba-fec8505e0be067a09929216cfe476802f21d14fe.zip |
s3: Avoid an unnecessary ftruncate call
If we just created the file, it has length 0 by definition. This is still done
while holding the share mode lock, so no race around wrt other cifs clients.
-rw-r--r-- | source3/smbd/open.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 55ea8960de..ba1fbf227c 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -2142,7 +2142,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, * If requested, truncate the file. */ - if (flags2&O_TRUNC) { + if (file_existed && (flags2&O_TRUNC)) { /* * We are modifing the file after open - update the stat * struct.. |