All of lore.kernel.org
 help / color / mirror / Atom feed
* CIFS support preallocate partially
       [not found] <599904512.8051095.1553257291511.JavaMail.zimbra@redhat.com>
@ 2019-03-22 12:23 ` Xiaoli Feng
  2019-03-22 16:01   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: Xiaoli Feng @ 2019-03-22 12:23 UTC (permalink / raw)
  To: CIFS; +Cc: Dave Chinner

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CIFS support preallocate partially
  2019-03-22 12:23 ` CIFS support preallocate partially Xiaoli Feng
@ 2019-03-22 16:01   ` Steve French
  2019-03-23  0:05     ` Xiaoli Feng
  0 siblings, 1 reply; 3+ messages in thread
From: Steve French @ 2019-03-22 16:01 UTC (permalink / raw)
  To: Xiaoli Feng; +Cc: CIFS, Dave Chinner

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)

On Fri, Mar 22, 2019 at 7:26 AM Xiaoli Feng <xifeng@redhat.com> wrote:
>
> 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



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: CIFS support preallocate partially
  2019-03-22 16:01   ` Steve French
@ 2019-03-23  0:05     ` Xiaoli Feng
  0 siblings, 0 replies; 3+ messages in thread
From: Xiaoli Feng @ 2019-03-23  0:05 UTC (permalink / raw)
  To: Steve French; +Cc: CIFS, Dave Chinner

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 -----
> From: "Steve French" <smfrench@gmail.com>
> To: "Xiaoli Feng" <xifeng@redhat.com>
> Cc: "CIFS" <linux-cifs@vger.kernel.org>, "Dave Chinner" <dchinner@redhat.com>
> 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)
> 
> On Fri, Mar 22, 2019 at 7:26 AM Xiaoli Feng <xifeng@redhat.com> wrote:
> >
> > 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
> 
> 
> 
> --
> Thanks,
> 
> Steve
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-23  0:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <599904512.8051095.1553257291511.JavaMail.zimbra@redhat.com>
2019-03-22 12:23 ` CIFS support preallocate partially Xiaoli Feng
2019-03-22 16:01   ` Steve French
2019-03-23  0:05     ` Xiaoli Feng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.