[PATCH] vfs_fileid: fix fsname_norootdir algorithm

Ralph Wuerthner ralphw at de.ibm.com
Tue Jan 15 16:35:03 UTC 2019


Hi Volker!

On 15.01.19 15:58, Volker Lendecke wrote:
> On Tue, Jan 15, 2019 at 11:50:57AM +0100, Ralph Wuerthner via samba-technical wrote:
>> Hi list!
>>
>> Please see attached patchset to fix the fsname_norootdir algorithm in the
>> VFS fileid module. I already opened Samba bugzilla 13744 because this is
>> broken since Samba 4.8.
> 
> RB+ on the first patch "fix fsname_norootdir". I'm not sure about the
> second one. What happens if you explicitly set the fileid:nolockinode
> parameter to do the hostname algorithm for a file somewhere in the
> share, not the root?
> 
> Volker
> 

You are right. I overlooked that data->nolockinode can be set via 
"fileid:nolockinode" and I'm withdrawing the second patch. Please see 
the updated patch.

-- 
Regards

Ralph
-------------- next part --------------
From fcf3ba42e0fc95db6239bd8adb293b59a5611927 Mon Sep 17 00:00:00 2001
From: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
Date: Tue, 15 Jan 2019 09:55:50 +0100
Subject: [PATCH] vfs_fileid: fix fsname_norootdir algorithm

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13744

Signed-off-by: Ralph Wuerthner <ralph.wuerthner at de.ibm.com>
---
 source3/modules/vfs_fileid.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c
index cb77a2e..cd6f9c3 100644
--- a/source3/modules/vfs_fileid.c
+++ b/source3/modules/vfs_fileid.c
@@ -456,7 +456,8 @@ static struct file_id fileid_file_id_create(struct vfs_handle_struct *handle,
 				struct fileid_handle_data,
 				return id);
 
-	if ((data->nolockinode != 0) && (id.inode == data->nolockinode)) {
+	if ((data->nolockinode != 0) &&
+	    (sbuf->st_ex_ino == data->nolockinode)) {
 		devid = fileid_device_mapping_hostname(data, sbuf);
 	} else {
 		devid = data->device_mapping_fn(data, sbuf);
-- 
2.7.4



More information about the samba-technical mailing list