[Samba] Does samba support fsync() a directory?

曹树烽 caosf.fnst at cn.fujitsu.com
Fri Feb 2 13:51:40 UTC 2018



在 2018年02月02日 21:34, 曹树烽 via samba 写道:
> Hi, Jeremy:
>
> >  That isn't any use. We don't need to know what is going on at the 
> client, we need to know what is going on at the server.
>
> I pasted the samba log here:
> https://raw.githubusercontent.com/CaoShuFeng/paste/master/samba_log
Hi, Jeremy:

I found that every time I open/fsync from client, I get such log from smbd

```
[2018/02/02 08:49:57.168805,  5, pid=23281, effective(0, 0), real(0, 0)] 
../source3/lib/messages.c:403(messaging_deregister)
   Deregistering messaging pointer for type 1 - private_data=(nil)
[2018/02/02 08:49:57.168823,  5, pid=23281, effective(0, 0), real(0, 0)] 
../source3/lib/messages.c:356(messaging_register)
   Registering messaging pointer for type 1 - private_data=(nil)
[2018/02/02 08:49:57.168845, 10, pid=23281, effective(0, 0), real(0, 0)] 
../source3/lib/util_event.c:99(event_add_idle)
   event_add_idle: idle_evt(keepalive) 0x55ba2410e480
[2018/02/02 08:49:57.168865, 10, pid=23281, effective(0, 0), real(0, 0)] 
../source3/lib/util_event.c:99(event_add_idle)
   event_add_idle: idle_evt(deadtime) 0x55ba2410e6d0
[2018/02/02 08:49:57.168888, 10, pid=23281, effective(0, 0), real(0, 0)] 
../source3/lib/util_event.c:99(event_add_idle)
   event_add_idle: idle_evt(housekeeping) 0x55ba2410e920
[2018/02/02 08:50:06.826194, 10, pid=23171, effective(0, 0), real(0, 0)] 
../source3/lib/util_sock.c:248(read_smb_length_return_keepalive)
   got smb length of 82
[2018/02/02 08:50:06.826315,  6, pid=23171, effective(0, 0), real(0, 0)] 
../source3/smbd/process.c:1955(process_smb)
   got message type 0x0 of len 0x52
[2018/02/02 08:50:06.826372,  3, pid=23171, effective(0, 0), real(0, 0)] 
../source3/smbd/process.c:1957(process_smb)
   Transaction 20 of length 86 (0 toread)
[2018/02/02 08:50:06.826420,  5, pid=23171, effective(0, 0), real(0, 0)] 
../source3/lib/util.c:171(show_msg)
[2018/02/02 08:50:06.826445,  5, pid=23171, effective(0, 0), real(0, 0)] 
../source3/lib/util.c:181(show_msg)
   size=82
   smb_com=0x32
   smb_rcls=0
   smb_reh=0
   smb_err=0
   smb_flg=0
   smb_flg2=49153
   smb_tid=30829
   smb_pid=5677
   smb_uid=26715
   smb_mid=8608
   smt_wct=15
   smb_vwv[ 0]=   16 (0x10)
   smb_vwv[ 1]=    0 (0x0)
   smb_vwv[ 2]=    2 (0x2)
   smb_vwv[ 3]= 4000 (0xFA0)
   smb_vwv[ 4]=    0 (0x0)
   smb_vwv[ 5]=    0 (0x0)
   smb_vwv[ 6]=    0 (0x0)
   smb_vwv[ 7]=    0 (0x0)
   smb_vwv[ 8]=    0 (0x0)
   smb_vwv[ 9]=   16 (0x10)
   smb_vwv[10]=   66 (0x42)
   smb_vwv[11]=    0 (0x0)
   smb_vwv[12]=    0 (0x0)
   smb_vwv[13]=    1 (0x1)
   smb_vwv[14]=    5 (0x5)
   smb_bcc=17
[2018/02/02 08:50:06.826757, 10, pid=23171, effective(0, 0), real(0, 0)] 
../lib/util/util.c:555(dump_data)
   [0000] 00 00 02 00 00 00 00 2F   00 61 00 61 00 61 00 00 ......./ 
.a.a.a..
   [0010] 00                                                 .
[2018/02/02 08:50:06.826823,  3, pid=23171, effective(0, 0), real(0, 0)] 
../source3/smbd/process.c:1538(switch_message)
   switch message SMBtrans2 (pid 23171) conn 0x55ba2411a3a0
[2018/02/02 08:50:06.826988,  0, pid=23171, effective(0, 0), real(0, 0)] 
../source3/smbd/process.c:1428(smb_dump)
   created /tmp/SMBtrans2.45.req len 86
[2018/02/02 08:50:06.827067,  4, pid=23171, effective(0, 0), real(0, 0)] 
../source3/smbd/sec_ctx.c:321(set_sec_ctx_internal)
   setting sec ctx (70, 70) - sec_ctx_stack_ndx = 0
[2018/02/02 08:50:06.827111,  5, pid=23171, effective(0, 0), real(0, 0)] 
../libcli/security/security_token.c:63(security_token_debug)
   Security token SIDs (7):
     SID[  0]: S-1-5-21-1340105488-494795474-4286701950-1003
     SID[  1]: S-1-5-21-1340105488-494795474-4286701950-513
     SID[  2]: S-1-22-2-70
     SID[  3]: S-1-1-0
     SID[  4]: S-1-5-2
     SID[  5]: S-1-5-11
     SID[  6]: S-1-22-1-70
    Privileges (0x               0):
    Rights (0x               0):
[2018/02/02 08:50:06.827255,  5, pid=23171, effective(0, 0), real(0, 0)] 
../source3/auth/token_util.c:639(debug_unix_user_token)
   UNIX token of user 70
   Primary group is 70 and contains 1 supplementary groups
   Group[  0]: 70
[2018/02/02 08:50:06.827329,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/uid.c:363(change_to_user_internal)
   Impersonated user: uid=(70,70), gid=(0,70)
[2018/02/02 08:50:06.827372,  3, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:5761(call_trans2qfilepathinfo)
   call_trans2qfilepathinfo: TRANSACT2_QPATHINFO: level = 512
[2018/02/02 08:50:06.827418,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/filename.c:443(unix_convert)
   unix_convert called on file "aaa"
[2018/02/02 08:50:06.827462,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/filename.c:644(unix_convert)
   unix_convert begin: name = aaa, dirpath = , start = aaa
[2018/02/02 08:50:06.827512,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/filename.c:667(unix_convert)
   conversion of base_name finished aaa -> aaa
[2018/02/02 08:50:06.827573, 10, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/files.c:756(file_name_hash)
   file_name_hash: /home/jane/aaa hash 0x3bde0c6f
[2018/02/02 08:50:06.827623,  3, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:5924(call_trans2qfilepathinfo)
   call_trans2qfilepathinfo aaa (fnum [fsp is NULL]) level=512 call=5 
total_data=0
[2018/02/02 08:50:06.827664,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:4827(smbd_do_qfilepathinfo)
   smbd_do_qfilepathinfo: aaa (fnum [fsp is NULL]) level=512 max_data=4000
[2018/02/02 08:50:06.827706,  8, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/dosmode.c:611(dos_mode)
   dos_mode: aaa
[2018/02/02 08:50:06.827751,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/dosmode.c:70(dos_mode_debug_print)
   dos_mode_debug_print: dos_mode_from_sbuf returning (0x10): "d"
[2018/02/02 08:50:06.827799,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/dosmode.c:70(dos_mode_debug_print)
   dos_mode_debug_print: dos_mode returning (0x10): "d"
[2018/02/02 08:50:06.827851, 10, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:4467(store_file_unix_basic)
   store_file_unix_basic: SMB_QUERY_FILE_UNIX_BASIC
[2018/02/02 08:50:06.827891,  4, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:4468(store_file_unix_basic)
   store_file_unix_basic: st_mode=40755
[2018/02/02 08:50:06.827947,  4, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:5392(smbd_do_qfilepathinfo)
   smbd_do_qfilepathinfo: SMB_QUERY_FILE_UNIX_BASIC
[2018/02/02 08:50:06.828036,  4, pid=23171, effective(70, 70), real(70, 
0)] ../lib/util/util.c:555(dump_data)
   [0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00 ........ 
........
   [0010] D6 16 C8 6B 28 9C D3 01   D6 16 C8 6B 28 9C D3 01 ...k(... 
...k(...
   [0020] D6 16 C8 6B 28 9C D3 01   46 00 00 00 00 00 00 00 ...k(... 
F.......
   [0030] 46 00 00 00 00 00 00 00   01 00 00 00 00 00 00 00 F....... 
........
   [0040] 00 00 00 00 2D 00 00 00   00 00 00 00 E4 4C AB 00 ....-... 
.....L..
   [0050] 00 00 00 00 ED 01 00 00   00 00 00 00 01 00 00 00 ........ 
........
   [0060] 00 00 00 00                                        ....
[2018/02/02 08:50:06.828345,  9, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:1111(send_trans2_replies)
   t2_rep: params_sent_thistime = 2, data_sent_thistime = 100, 
useable_space = 16406
[2018/02/02 08:50:06.828378,  9, pid=23171, effective(70, 70), real(70, 
0)] ../source3/smbd/trans2.c:1113(send_trans2_replies)
   t2_rep: params_to_send = 2, data_to_send = 100, paramsize = 2, 
datasize = 100
[2018/02/02 08:50:06.828422,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/lib/util.c:171(show_msg)
[2018/02/02 08:50:06.828448,  5, pid=23171, effective(70, 70), real(70, 
0)] ../source3/lib/util.c:181(show_msg)
   size=160
   smb_com=0x32
   smb_rcls=0
   smb_reh=0
   smb_err=0
   smb_flg=128
   smb_flg2=51203
   smb_tid=30829
   smb_pid=5677
   smb_uid=26715
   smb_mid=8608
   smt_wct=10
   smb_vwv[ 0]=    2 (0x2)
   smb_vwv[ 1]=  100 (0x64)
   smb_vwv[ 2]=    0 (0x0)
   smb_vwv[ 3]=    2 (0x2)
   smb_vwv[ 4]=   56 (0x38)
   smb_vwv[ 5]=    0 (0x0)
   smb_vwv[ 6]=  100 (0x64)
   smb_vwv[ 7]=   60 (0x3C)
   smb_vwv[ 8]=    0 (0x0)
   smb_vwv[ 9]=    0 (0x0)
   smb_bcc=105
[2018/02/02 08:50:06.828800, 10, pid=23171, effective(70, 70), real(70, 
0)] ../lib/util/util.c:555(dump_data)
   [0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00 ........ 
........
   [0010] 00 00 00 00 00 D6 16 C8   6B 28 9C D3 01 D6 16 C8 ........ 
k(......
   [0020] 6B 28 9C D3 01 D6 16 C8   6B 28 9C D3 01 46 00 00 k(...... 
k(...F..
   [0030] 00 00 00 00 00 46 00 00   00 00 00 00 00 01 00 00 .....F.. 
........
   [0040] 00 00 00 00 00 00 00 00   00 2D 00 00 00 00 00 00 ........ 
.-......
   [0050] 00 E4 4C AB 00 00 00 00   00 ED 01 00 00 00 00 00 ..L..... 
........
   [0060] 00 01 00 00 00 00 00 00   00 ........ .
```

Thanks
Cao


>
> The file I fsync()ing is called `aaa`. I can see some log about this 
> file.
>
> Thanks
> Cao
>
> 在 2018年02月02日 21:07, Jeremy Allison 写道:
>> On Fri, Feb 02, 2018 at 09:05:44PM +0800, 曹树烽 via samba wrote:
>>> Hi, Jeremy:
>>>
>>>>   Can you show us the wireshark trace and the smbd logs
>>> Sorry that I don't known how to use wireshark now.
>>>
>>> I have the ptrace log:
>> That isn't any use. We don't need to know what is going
>> on at the client, we need to know what is going on at
>> the server.
>>
>>
>>
>
>
>
>






More information about the samba mailing list