Skip to contentSkip to conversation

CIFS support preallocate partially

DISCUSSION Xiaoli Feng 2 participants 3 messages Mar 22, 2019 – Mar 23, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hello,

Use xfs_io to test preallocate. It returns successfuly. But it's a empty file. And doesn't allocate space.

# mount //localhost/cifs  ~/cifs
# xfs_io -f -c "resvsp 4 4" cifs/file
# du -h cifs/file
0	cifs/file

Test on xfs:

# rm -rf file
# xfs_io -f -c "resvsp 4 4" file
# du -h file
4.0K	file

Is it expected for cifs? I think the size should be a block size(1M for cifs).

Thanks.

Signature · 8 lines
Best regards!
XiaoLi Feng 冯小丽

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom
#2 lore raw

No preallocate is actually sent on the wire (other than creating the
file) in the example you tried. Some servers do not support
preallocate - do you know the expected behavior on a local file system that does not support preallocate whether it should 1) fail to create the file and return an error or 2) succeed in creating the file (even though couldn't preallocate the size).

Looking at the code I am surprised it is not returning an error message though it looks like smb3_simple_falloc would return an EOPNOTSUPP error (at least if allocating more than a few pages beyond end of file)

Quoted 30 lines · Xiaoli Feng

Hello,

Use xfs_io to test preallocate. It returns successfuly. But it's a empty file. And doesn't allocate space.

# mount //localhost/cifs  ~/cifs
# xfs_io -f -c "resvsp 4 4" cifs/file
# du -h cifs/file
0       cifs/file

Test on xfs:

# rm -rf file
# xfs_io -f -c "resvsp 4 4" file
# du -h file
4.0K    file

Is it expected for cifs? I think the size should be a block size(1M for cifs).

Thanks.

--
Best regards!
XiaoLi Feng 冯小丽

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom

Signature · 3 lines
Thanks,

Steve
#3 lore raw

I don't know what local file system that does not support preallocate. But I test nfs. It return "Operation not supported" and create a zero size file.

# xfs_io -f -c "resvsp 4 4" nfs/file
XFS_IOC_RESVSP64: Operation not supported
# echo $?
0
# du -h nfs/file
0	nfs/file

----- Original Message -----

Quoted 59 lines

From: "Steve French" <[email protected]>
To: "Xiaoli Feng" <[email protected]>
Cc: "CIFS" <[email protected]>, "Dave Chinner" <[email protected]>
Sent: Saturday, March 23, 2019 12:01:50 AM
Subject: Re: CIFS support preallocate partially

No preallocate is actually sent on the wire (other than creating the
file) in the example you tried. Some servers do not support
preallocate - do you know the expected behavior on a local file system that does not support preallocate whether it should 1) fail to create the file and return an error or 2) succeed in creating the file (even though couldn't preallocate the size).

Looking at the code I am surprised it is not returning an error message though it looks like smb3_simple_falloc would return an EOPNOTSUPP error (at least if allocating more than a few pages beyond end of file)

Quoted 27 lines · Xiaoli Feng

Hello,

Use xfs_io to test preallocate. It returns successfuly. But it's a empty file. And doesn't allocate space.

# mount //localhost/cifs  ~/cifs
# xfs_io -f -c "resvsp 4 4" cifs/file
# du -h cifs/file
0       cifs/file

Test on xfs:

# rm -rf file
# xfs_io -f -c "resvsp 4 4" file
# du -h file
4.0K    file

Is it expected for cifs? I think the size should be a block size(1M for cifs).

Thanks.

--
Best regards!
XiaoLi Feng 冯小丽

Quoted 5 lines

Red Hat Software (Beijing) Co.,Ltd
filesystem-qe Team
IRC:xifeng,#channel: fs-qe
Tel:+86-10-8388112
9/F, Raycom

--
Thanks,

Steve