James Wright <12wrigja at gmail.com> 9:56 PM (13 minutes ago) to samba Hi Samba users, I have a Samba server with a single share backed by a ZFS pool / collection of datasets. I can correctly navigate around the share, but the free space reporting within clients is inaccurate for various directories, especially those that are themselves setup as datasets in ZFS and have quota applied to them. I read over the documentation for both the 'dfree' and 'get quota command' options, but it seems that the paths those pass as their first parameter are useless to me, as they mostly seem to be the share's root (represented as '.'), not the actual path being queried. Looking over the SAMBA source, I believe that if https://github.com/samba-team/samba/blob/f33749fc84dacb164d1ac43f6bfcae7afcca34b3/source3/smbd/dfree.c#L63 was changed to pass the entire filepath to the dfree command I could achieve what I wanted. A couple questions: - Is the filename that is passed there the name of the directory being queried, or is my understanding incorrect? - in many places, it's common to see that variable called with the basename function. I can't seem to find where that is defined - any pointers? - If this is something that would work, would the samba team be open to adding this as an option to the dfree config, as I image that it's probably not guaranteed to be backwards-compatible with the existing behaviour. Thanks, James
Eventually, I found that the reason this doesn't appear to work is that most clients request for filesystem information without sending "Create File" requests for their current directory and using that file handle in the request. This confuses me, as https://github.com/samba-team/samba/commit/8f121747b06ca78cf51801a3931b2ddd1a424c77#diff-1247a69e75ffda08ca38bf737ea9b21e seems to imply that there was some notion that the commands sent to the dfree code would (could?) include a proper path. I know it's mentioned in the docs that "most of the time" the path passed is just ".", but now I'm interested in knowing when this isn't the case, and what I would have to do to have this occur. On Wed, Feb 20, 2019 at 10:11 PM James Wright <12wrigja at gmail.com> wrote:> > James Wright <12wrigja at gmail.com> > 9:56 PM (13 minutes ago) > to samba > Hi Samba users, > > I have a Samba server with a single share backed by a ZFS pool / > collection of datasets. I can correctly navigate around the share, but the > free space reporting within clients is inaccurate for various directories, > especially those that are themselves setup as datasets in ZFS and have > quota applied to them. > > I read over the documentation for both the 'dfree' and 'get quota command' > options, but it seems that the paths those pass as their first parameter > are useless to me, as they mostly seem to be the share's root (represented > as '.'), not the actual path being queried. > > Looking over the SAMBA source, I believe that if > https://github.com/samba-team/samba/blob/f33749fc84dacb164d1ac43f6bfcae7afcca34b3/source3/smbd/dfree.c#L63 was > changed to pass the entire filepath to the dfree command I could achieve > what I wanted. A couple questions: > > - Is the filename that is passed there the name of the directory being > queried, or is my understanding incorrect? > - in many places, it's common to see that variable called with the > basename function. I can't seem to find where that is defined - any > pointers? > - If this is something that would work, would the samba team be open to > adding this as an option to the dfree config, as I image that it's probably > not guaranteed to be backwards-compatible with the existing behaviour. > > Thanks, > > James >
On 2019-02-20 at 22:11 -0800 James Wright via samba sent off:> I read over the documentation for both the 'dfree' and 'get quota command' > options, but it seems that the paths those pass as their first parameter > are useless to me, as they mostly seem to be the share's root (represented > as '.'), not the actual path being queried.you might have a look at that old patch from https://bugzilla.samba.org/show_bug.cgi?id=9371#c0 and see if that works for you. Björn -- SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen phone: 0551-370000-0, mail: kontakt at sernet.de Gesch.F.: Dr. Johannes Loxen & Reinhild Jung AG Göttingen: HR-B 2816 - https://www.sernet.de
I think, if I'm reading the patch correctly, it would still only query per mount path, not per subdirectory in a mount path. I think client-side changes might be necessary in this case - seems that the Ubuntu/Debian kernel implementations of cifs query for file system info without giving the current directory path, so the server has so source for that info. On Mon, 25 Feb 2019, 00:47 Björn JACKE, <bj at sernet.de> wrote:> On 2019-02-20 at 22:11 -0800 James Wright via samba sent off: > > I read over the documentation for both the 'dfree' and 'get quota > command' > > options, but it seems that the paths those pass as their first parameter > > are useless to me, as they mostly seem to be the share's root > (represented > > as '.'), not the actual path being queried. > > you might have a look at that old patch from > https://bugzilla.samba.org/show_bug.cgi?id=9371#c0 and see if that works > for you. > > Björn > -- > SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen > phone: 0551-370000-0, mail: kontakt at sernet.de > Gesch.F.: Dr. Johannes Loxen & Reinhild Jung > AG Göttingen: HR-B 2816 - https://www.sernet.de >