Ticket #3928 (new defect)

Opened 4 months ago

Last modified 4 months ago

vfs_preallocate return 0 if fallocate not supported

Reported by: gray_-_wolf Owned by:
Priority: minor Milestone: Future Releases
Component: mc-vfs Version: master
Keywords: Cc: wolf+mc@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by andrew_b) (diff)

In lib/vfs/vfs.c int vfs_preallocate claims to return 0 on success and non-zero otherwise, therefore it should not 0 when fallocate is not even supported (that is hardly success...). Shouldn't it be -1?

Change History

comment:1 Changed 4 months ago by gray_-_wolf

  • Cc wolf+mc@… added

comment:2 Changed 4 months ago by andrew_b

  • Component changed from mc-core to mc-vfs
  • Description modified (diff)

comment:3 Changed 4 months ago by andrew_b

Returning not 0 if fallocate is not supported avoids the raise of message "Cannot preallocate space for target file". Perhaps, we should set the errno to ENOTSUPP.
Regardless of reason why vfs_preallocate() returns not 0, file copy starts anyway.

Note: See TracTickets for help on using tickets.