openzfsonwindows / openzfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
402 stars 15 forks source link

BSOD while deleting/copying #347

Open derritter88 opened 5 months ago

derritter88 commented 5 months ago

System information

Type Version/Name
Distribution Name Windows 11 23H2
Architecture amd64
OpenZFS Version zfs-2.2.99-1-g24427350f6

Describe the problem you're observing

I was deleting files from one drive and copying stuff on a different drive (both ZFS) and got a BSOD.

DumpStack.log cbuf.txt info.txt stack.txt

lundman commented 5 months ago
08 fffffb88`22737450 fffff804`4eb6eab0     OpenZFS!vnode_put+0xe
09 fffffb88`22737490 fffff804`4e80614a     OpenZFS!zfs_znode_asyncput_impl+0x30

OK vp is NULL. Leet me look deeper

derritter88 commented 5 months ago

Okay it's linked to a deletion process - I tried it again and it crashed again.

derritter88 commented 5 months ago

Not sure if this is useful or not but I used Powershell admin mode & rm -fo <foldername> to delete the folder + all subfolders & files

inoperable commented 5 months ago

Not sure if this is useful or not but I used Powershell admin mode & rm -fo <foldername> to delete the folder + all subfolders & files

Try using msys2 and add ...\msys2\usr\bin it your PATH (setx PATH ...\msys2\usr\bin;%PATH% /m - /m sets it globally) and use linux core/bin utils for all file operations. I do this since a a very long time - since it makes Windows cli bearable - and have no problems with zfs, if any BSOD then most of the time related to caching/async multithread queued stuff. qBittorrent with enabled os cached was for example instant BSOD earlier on.

You can prune the powershell aliases by add stuff to your $PROFILE

#IF (Get-Alias sort  -ErrorAction Ignore) { Remove-Item alias:sort  -Force };
#IF (Get-Alias which -ErrorAction Ignore) { Remove-Item alias:which -Force };
#IF (Get-Alias where -ErrorAction Ignore) { Remove-Item alias:where -Force };
IF (Get-Alias pbcopy -ErrorAction Ignore) { Remove-Item alias:pbcopy };
IF (Get-Alias cp     -ErrorAction Ignore) { Remove-Item alias:cp     };
IF (Get-Alias ls     -ErrorAction Ignore) { Remove-Item alias:ls     };
IF (Get-Alias mv     -ErrorAction Ignore) { Remove-Item alias:mv     };
IF (Get-Alias man    -ErrorAction Ignore) { Remove-Item alias:man    };
IF (Get-Alias ln     -ErrorAction Ignore) { Remove-Item alias:ln     };
IF (Get-Alias head   -ErrorAction Ignore) { Remove-Item alias:head   };
IF (Get-Alias tail   -ErrorAction Ignore) { Remove-Item alias:tail   };
IF (Get-Alias git    -ErrorAction Ignore) { Remove-Item alias:git    };
IF (Get-Alias du     -ErrorAction Ignore) { Remove-Item alias:du     };
#IF (Get-Alias find  -ErrorAction Ignore) { Remove-Item alias:find   };
Set-Alias   -Name   cp       -Value   'cp.exe';
Set-Alias   -Name   ls       -Value   'ls.exe';
Set-Alias   -Name   mv       -Value   'mv.exe';
Set-Alias   -Name   man      -Value   'Get-Help';
Set-Alias   -Name   du       -Value   'du.exe';
Set-Alias   -Name   df       -Value   'df.exe';
Set-Alias   -Name   du       -Value   'du.exe';

pruning find / sort can be problematic becasue those are cmd.exe fubar utils and they clash with msys2 same named files - rename those to gfind.exe and gsort.exe and all is good, which.exe/where.exe is interwoven in some ms .bat files from time to time (because why not...) so I had to comment those out. As bonus: you don't need to give a **ht about \ or / problems anymore

inoperable commented 5 months ago

one last thing I forgot to add, try clink as it really makes you forget how bad cmd.exe and it feels more like real shell for change. Once you start using clink then its the point of no return to bare cmd.exe :-)

derritter88 commented 5 months ago

@inoperable May I then still use Terminal with msys2 or would I need to use a separate terminal window? This was the reason why I ditched cygwin some years ago

lundman commented 5 months ago

a6951e4 will attempt to at least avoid crashing if vp is NULL in this place. May just block the unmount forever though :)

You able to try commit directly, or would you like a build to try?

inoperable commented 5 months ago

You can use whatever terminal you like, the one supplied with msys2 is very good as well - just add the coreutils to your path variable , make sure it pretends the windows paths and you can do ls.exe from CMD.exe 😂 or rm.exe etc, and using clink on to of that and it makes you forget its windows from time to time

On Thu, Feb 1, 2024, 01:05 Jorgen Lundman @.***> wrote:

a6951e4 https://github.com/openzfsonwindows/openzfs/commit/a6951e43bf86412cd0d66da49654c3fcab01d7bc will attempt to at least avoid crashing if vp is NULL in this place. May just block the unmount forever though :)

You able to try commit directly, or would you like a build to try?

— Reply to this email directly, view it on GitHub https://github.com/openzfsonwindows/openzfs/issues/347#issuecomment-1920220978, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAL7SAURCOLBX62622JCGVTYRLL3XAVCNFSM6AAAAABCQ5Z5JOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMRQGIZDAOJXHA . You are receiving this because you were mentioned.Message ID: @.***>

derritter88 commented 5 months ago

a6951e4 will attempt to at least avoid crashing if vp is NULL in this place. May just block the unmount forever though :)

You able to try commit directly, or would you like a build to try?

I already have some troubles with unmounting a pool. In general I prefere a build to try.

derritter88 commented 5 months ago

@inoperable I have tried to use that yesterday - so far it worked but I was not able to create an alias for ll as my standard Linux for that is ls -lah. I always got an error message from Windows for that. So I stopped using it again :-/

inoperable commented 5 months ago

Since MS does what it does, I made myself a snipet generator for whatever command needs replacement and it spits out this heresy below and also a ls.ps1 automaticall.

And once started with dos pruning I went so far that adding it into WindowsRE makes it actually useful for something (instead of letting you to glare at the prompt and wish its zsh)

I would go total bash/zsh on Win32 but thats not possible since as usual M$ reimplemented the longest known hierarchical ordering symbol known to humans:

from / to \ - why not, right?

───────┬────────────────────────────────────────────────────────────────────────────────────────────
       │ File: ls.cmd
───────┼────────────────────────────────────────────────────────────────────────────────────────────
   1   │ @ECHO OFF
   2   │
   3   │ set EXA_LOCAL="%BIN%\exa.exe"
   4   │ SET EXA_SCOOP="%SCOOP%\apps\exa\current\exa.exe"
   5   │ SET EZA_PRTBL="%PORTABLE%\misc\eza.exe"
   6   │ SET DIRLISTER=
   7   │
   8   │ IF EXIST %EZA_PRTBL% (
   9   │     SET DIRLISTER=%EZA_PRTBL%
  10   │ ) ELSE IF EXIST %EXA_LOCAL% (
  11   │     SET DIRLISTER=%EXA_LOCAL%
  12   │ ) ELSE IF EXIST %EXA_SCOOP% (
  13   │     SET DIRLISTER=%EXA_SCOOP%
  14   │ ) ELSE (
  15   │     SET DIRLISTER=%PORTABLE%\msys2\usr\bin\ls.exe
  16   │ )
  17   │
  18   │ IF "%*" NEQ "" (
  19   │     %DIRLISTER% --sort=ext --color=always --group-directories-first %*
  20   │     GOTO :EOF
  21   │ ) ELSE (
  22   │     %DIRLISTER% --sort=ext --color=always --group-directories-first
  23   │     GOTO :EOF
  24   │ )
  25   │
  26   │ @ECHO [WARNING] using dir.exe command instead of ls.exe
  27   │ dir /a /l
  28   │
  29   │
  30   │
───────┴────────────────────────────────────────────────────────────────────────────────────────────
inoperable commented 5 months ago

image

ls/exa vs. dir lol - with history and autosuggestions, this is blasphemy! (but it works :))

derritter88 commented 5 months ago

@inoperable thanks for the suggestions and tips! Will look at it.

@lundman I think the problem with deleting files is linked to #348 I tried to delete something within a mounted folder and Windows just mentiones that the file is not being found.