PCDVD數位科技討論區
PCDVD數位科技討論區   註冊 常見問題 標記討論區為已讀

回到   PCDVD數位科技討論區 > 其他群組 > 疑難雜症區
帳戶
密碼
 

回應
 
主題工具
cmwang
Elite Member
 

加入日期: May 2002
您的住址: 板橋
文章: 5,112
FreeBSD mmap on CIFS share....

鵝公司的產品因為是based on FreeBSD這個不算太熱門的OS上,而RD說讀寫檔案因為效能考量是以mmap方式處理,之前都是要user提供NFS的storage(CIFS的話只知道因為歷史因素不建議用,但為啥不能用沒人說得出所以然),最近因為user強力要求要配合CIFS storage,鵝只好拿FreeBSD去mount CIFS share,然後用iozone指定以mmap方式測試,結果果然是不work,不過讓鵝大惑不解的是iozone讀寫CIFS/NFS的方式都一樣,為啥上方的CIFS會在gettimeofday這個看似和filesystem扯不上邊的動作後產生SIGSEGV而被kill掉,但下方的NFS則一切正常啊....
     
      
上傳的圖像
文件類型: jpg cifs-nfs.jpg (188.0 KB, 75次瀏覽)
__________________
士大夫之無恥,是謂國恥....
舊 2016-09-09, 08:19 PM #1
回應時引用此文章
cmwang離線中  
cmwang
Elite Member
 

加入日期: May 2002
您的住址: 板橋
文章: 5,112
鵝後來找到Subject: Re: ports/29704: Imagemagick Identify utility crashes when used on smbfs mounted share....

引用:
Yes, this is an expected behavior - smbfs uses a counter to track open/close operations and if it became zero, an SMB "close" request sent to server. Obviously, mmap() doesn't give additional VOP_OPEN() call and file is really closed after close(), so any subsequent read/write operation will fail.

In the DOS/Windows world it is normal to have strong relation between open/close operations, while VOP_OPEN()/VOP_CLOSE() in FreeBSD do not match sometime (I'm suspect that it is possible to remove inconsistence, though).

One of the possible solutions is to remove smb_close request from smbfs_close() vop and leave it only in the smbfs_inactive(), but this will not allow programs to immediately release a file by just closing it.


看來是FreeBSD對VOP_OPEN/VOP_CLOSE的解釋造成的,難怪從十幾年前就是這樣了....
 
舊 2016-09-19, 06:05 PM #2
回應時引用此文章
cmwang離線中  


回應


POPIN
主題工具

發表文章規則
不可以發起新主題
不可以回應主題
不可以上傳附加檔案
不可以編輯您的文章

vB 代碼打開
[IMG]代碼打開
HTML代碼關閉



所有的時間均為GMT +8。 現在的時間是08:04 PM.


vBulletin Version 3.0.1
powered_by_vbulletin 2026。