Bug 103669 - Can not swapoff a swap file larger than 2G
Summary: Can not swapoff a swap file larger than 2G
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: kernel
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Arjan van de Ven
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-09-03 18:47 UTC by Frank Hirtz
Modified: 2007-11-30 22:06 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-09-03 19:28:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Frank Hirtz 2003-09-03 18:47:24 UTC
Description of problem:
When a swapfile is created which is larger than 2G and enabled, it can not be
disabled with the `swapoff` command. It reports "swapoff: <filename>: File too
large".

Version-Release number of selected component (if applicable):
mount-2.11y-24

How reproducible:
Always

Steps to Reproduce:
1.Create swap file larger than 2G
2.enable swapfile with 'swapon'
3.attempt to disable swapfile with `swapoff <device>` || `swapoff -a`
    
Actual results:

[root@charm /]# dd if=/dev/zero of=/tmp/swapfile2 bs=100M count=22
22+0 records in
22+0 records out
[root@charm /]# mkswap /tmp/swapfile2 
Setting up swapspace version 1, size = 2306863 kB
[root@charm /]# vim /etc/fstab 
[root@charm /]# free -k
             total       used       free     shared    buffers     cached
Mem:        253324     244532       8792          0      25680      93292
-/+ buffers/cache:     125560     127764
Swap:      4610056          0    4610056
[root@charm /]# swapon /tmp/swapfile2 
[root@charm /]# free -k
             total       used       free     shared    buffers     cached
Mem:        253324     244552       8772          0      25696      93292
-/+ buffers/cache:     125564     127760
Swap:      6862848          0    6862848
[root@charm /]# swapoff /tmp/swapfile2 
swapoff: /tmp/swapfile2: File too large
[root@charm /]# swapon -s
Filename                        Type            Size    Used    Priority
/dev/hdb2                       partition       257032  0       -4
/dev/hda2                       partition       257032  0       -5
/tmp/swapfile                   file            4095992 0       -3
/tmp/swapfile2                  file            2252792 0       -6
[root@charm /]# swapoff -a
[root@charm /]# swapon -s
Filename                        Type            Size    Used    Priority
/tmp/swapfile                   file            4095992 0       -3
/tmp/swapfile2                  file            2252792 0       -6
[root@charm /]# 


Expected results:

swapoff should disable the swapfile in question.


Additional info:

I don't presently have the bandwidth to check this with swap partitions, but
don't see why the behavior would be any different.

Reporting this under 'kernel' due to lack of 'mount' component in the list.

Comment 1 Bill Nottingham 2003-09-03 19:28:41 UTC
Fixed in the .405 or later kernel.


Note You need to log in before you can comment on or make changes to this bug.