The Samba-Bugzilla – Attachment 9836 Details for
Bug 10543
Small sized files can result in an allocation size of 0 (zero)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix for 4.0, cherry-picked from master
fix-bug-10543-v4-0-test.patch (text/plain), 1.56 KB, created by
Björn Baumbach
on 2014-04-07 09:46:38 UTC
(
hide
)
Description:
fix for 4.0, cherry-picked from master
Filename:
MIME Type:
Creator:
Björn Baumbach
Created:
2014-04-07 09:46:38 UTC
Size:
1.56 KB
patch
obsolete
>From d058d079ebc2388e31a87896fc8fc243e8b00409 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Baumbach?= <bb@sernet.de> >Date: Thu, 27 Mar 2014 11:17:30 +0100 >Subject: [PATCH] s3: enforce a positive allocation_file_size for non-empty > files (bug #10543) >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Some file systems do not allocate a block for very >small files. But for non-empty file should report a >positive size. > >Pair-Programmed-With: Michael Adam <obnox@samba.org> > >Signed-off-by: Björn Baumbach <bb@sernet.de> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Sat Apr 5 03:09:00 CEST 2014 on sn-devel-104 > >(cherry picked from commit c35b31f45244a8339684c3b83a7d86eefb80e0da) >--- > source3/modules/vfs_default.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c >index 75dd5ac..d2b01d2 100644 >--- a/source3/modules/vfs_default.c >+++ b/source3/modules/vfs_default.c >@@ -1355,6 +1355,18 @@ static uint64_t vfswrap_get_alloc_size(vfs_handle_struct *handle, > #else > #error SIZEOF_BLKCNT_T_NOT_A_SUPPORTED_VALUE > #endif >+ if (result == 0) { >+ /* >+ * Some file systems do not allocate a block for very >+ * small files. But for non-empty file should report a >+ * positive size. >+ */ >+ >+ uint64_t filesize = get_file_size_stat(sbuf); >+ if (filesize > 0) { >+ result = MIN((uint64_t)STAT_ST_BLOCKSIZE, filesize); >+ } >+ } > #else > result = get_file_size_stat(sbuf); > #endif >-- >1.8.3.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review+
obnox
:
review+
kseeger
:
review?
(
jra
)
Actions:
View
Attachments on
bug 10543
:
9835
| 9836