The Samba-Bugzilla – Attachment 11272 Details for
Bug 11403
smbd ignores the block size of the dfree command
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for 4.2
42.patch (text/plain), 2.71 KB, created by
Andreas Schneider
on 2015-07-20 09:32:32 UTC
(
hide
)
Description:
patch for 4.2
Filename:
MIME Type:
Creator:
Andreas Schneider
Created:
2015-07-20 09:32:32 UTC
Size:
2.71 KB
patch
obsolete
>From 80d7fe6f06c820253d0c687153a3c781bc55cb0c Mon Sep 17 00:00:00 2001 >From: Andreas Schneider <asn@samba.org> >Date: Fri, 17 Jul 2015 09:35:11 +0200 >Subject: [PATCH] s3-smbd: Leave sys_disk_free() if dfree command is used > >If we have a broken system which reports incorrect sizes we provide the >'dfree command'. This command makes sure Samba gets the correct values. >However after that we call the quota command which then reports the >broken values. The dfree command should take care to provide the correct >values and in case of quota's it should also calculate the quote >correctly. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=11403 > >Pair-Programmed-With: Michael Adam <obnox@samba.org> >Signed-off-by: Andreas Schneider <asn@samba.org> >Signed-off-by: Michael Adam <obnox@samba.org> >Reviewed-by: Ralph Boehme <slow@samba.org> >(cherry picked from commit 48a4d5a4078ff2a66dd753323d6e5d76d34b9828) >--- > source3/smbd/dfree.c | 29 +++++++++++++---------------- > 1 file changed, 13 insertions(+), 16 deletions(-) > >diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c >index d02c1bd..09b00f4 100644 >--- a/source3/smbd/dfree.c >+++ b/source3/smbd/dfree.c >@@ -98,7 +98,7 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_que > DEBUG (3, ("disk_free: Running command '%s'\n", syscmd)); > > lines = file_lines_pload(syscmd, NULL); >- if (lines) { >+ if (lines != NULL) { > char *line = lines[0]; > > DEBUG (3, ("Read input from dfree, \"%s\"\n", line)); >@@ -122,22 +122,18 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_que > *dsize = 2048; > if (!*dfree) > *dfree = 1024; >- } else { >- DEBUG (0, ("disk_free: file_lines_load() failed for " >- "command '%s'. Error was : %s\n", >- syscmd, strerror(errno) )); >- if (sys_fsusage(path, dfree, dsize) != 0) { >- DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n", >- strerror(errno) )); >- return (uint64_t)-1; >- } >- } >- } else { >- if (sys_fsusage(path, dfree, dsize) != 0) { >- DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n", >- strerror(errno) )); >- return (uint64_t)-1; >+ >+ goto dfree_done; > } >+ DEBUG (0, ("disk_free: file_lines_load() failed for " >+ "command '%s'. Error was : %s\n", >+ syscmd, strerror(errno) )); >+ } >+ >+ if (sys_fsusage(path, dfree, dsize) != 0) { >+ DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n", >+ strerror(errno) )); >+ return (uint64_t)-1; > } > > if (disk_quotas(path, &bsize_q, &dfree_q, &dsize_q)) { >@@ -161,6 +157,7 @@ uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_que > *dfree = MAX(1,*dfree); > } > >+dfree_done: > disk_norm(small_query,bsize,dfree,dsize); > > if ((*bsize) < 1024) { >-- >2.4.5 >
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:
slow
:
review+
Actions:
View
Attachments on
bug 11403
: 11272 |
11273