tux3: Fix umount race with flusher

While umount, do_commit can race with umount. So, this checks if need
to commit or not. Otherwise, e.g. sb->logmap can be freed already by

As bonus, if sync/fsync() called when has no dirty inodes, this exits
do_commit() immediately.

- there is no need to commit if normal inodes are not dirty?
  (there is no case of internal inodes only dirty?)
- this way may be fragile. ->put_super() should wait to stop flusher?

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
3 files changed