Re: What's expected for swapping on samba share

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

----- Original Message -----
> From: "Steve French" <smfrench@xxxxxxxxx>
> To: "Xiaoli Feng" <xifeng@xxxxxxxxxx>
> Cc: "Ronnie Sahlberg" <lsahlber@xxxxxxxxxx>, "Xiong Zhou" <xzhou@xxxxxxxxxx>, "CIFS" <linux-cifs@xxxxxxxxxxxxxxx>
> Sent: Tuesday, January 8, 2019 2:37:36 PM
> Subject: Re: What's expected for swapping on samba share
> 
> I would not expect swap to work directly on smb3 mounts (we don't implement
> that vfs entry point) although probably would not be too hard to add. I
> would expect you be able to map a block device (Ala loopback) as a file on
> an smb3 share though and then swap to that. Let me know what you see when
> you try

Thanks Steve. And it works via loopback.

# dd if=/dev/zero of=cifs/file bs=4k count=1024
# losetup /dev/loop0 cifs/file
# mkswap /dev/loop0
mkswap: /dev/loop0: warning: wiping old swap signature.
Setting up swapspace version 1, size = 4 MiB (4190208 bytes)
no label, UUID=798f943b-8525-4c11-a3f9-3d1a97eaa860
# free -m
              total        used        free      shared  buff/cache   available
Mem:           3819         298        2453          16        1068        3262
Swap:          3951           0        3951
# swapon /dev/loop0   
# free -m
              total        used        free      shared  buff/cache   available
Mem:           3819         298        2453          16        1068        3262
Swap:          3955           0        3955




> 
> On Tue, Jan 8, 2019, 00:33 Xiaoli Feng <xifeng@xxxxxxxxxx wrote:
> 
> > Hi,
> >   When I try to swapon a file on samba share in upstream, it's failed with
> > "swapon failed: Invalid argumen".
> > I'm not sure if it's expected or a bug. Could you tell me more about it?
> >
> > # dd if=/dev/zero of=file bs=4k count=1024
> > 1024+0 records in
> > 1024+0 records out
> > 4194304 bytes (4.2 MB, 4.0 MiB) copied, 0.114088 s, 36.8 MB/s
> > # mkswap file
> > mkswap: file: insecure permissions 0755, 0600 suggested.
> > Setting up swapspace version 1, size = 4 MiB (4190208 bytes)
> > no label, UUID=81ae8f60-c04a-4c1b-8b63-d441fdbf3a92
> > # swapon file
> > swapon: /root/cifs/file: insecure permissions 0755, 0600 suggested.
> > swapon: /root/cifs/file: swapon failed: Invalid argument
> > # uname -r
> > 5.0.0-rc1+
> >
> > Thanks.
> >
> > --
> > Best regards!
> > XiaoLi Feng 冯小丽
> >
> > Red Hat Software (Beijing) Co.,Ltd
> > filesystem-qe Team
> > IRC:xifeng,#channel: fs-qe
> >
> 



[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux