]> git.openpandora.org Git - pandora-kernel.git/commitdiff
fs: disallow all fallocate operation on active swapfile
authorLukas Czerner <lczerner@redhat.com>
Sat, 12 Apr 2014 14:05:37 +0000 (10:05 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 12 Apr 2014 14:05:37 +0000 (10:05 -0400)
Currently some file system have IS_SWAPFILE check in their fallocate
implementations and some do not. However we should really prevent any
fallocate operation on swapfile so move the check to vfs and remove the
redundant checks from the file systems fallocate implementations.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ceph/file.c
fs/ext4/extents.c
fs/ext4/inode.c
fs/open.c

index 09c7afe32e496c7dfe20d527106c7a184248c3ca..596e6cc9f9c4a173814b03905551334bdea143c4 100644 (file)
@@ -1215,9 +1215,6 @@ static long ceph_fallocate(struct file *file, int mode,
        if (!S_ISREG(inode->i_mode))
                return -EOPNOTSUPP;
 
-       if (IS_SWAPFILE(inode))
-               return -ETXTBSY;
-
        mutex_lock(&inode->i_mutex);
 
        if (ceph_snap(inode) != CEPH_NOSNAP) {
index ac5460d0d133706d4efd7a1e2affbb43e0c9b46c..b2d3869b576248ef1c980d62ef6178d416a262e0 100644 (file)
@@ -5405,11 +5405,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
                goto out_mutex;
        }
 
-       if (IS_SWAPFILE(inode)) {
-               ret = -ETXTBSY;
-               goto out_mutex;
-       }
-
        /* Currently just for extent based files */
        if (!ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS)) {
                ret = -EOPNOTSUPP;
diff --cc fs/ext4/inode.c
Simple merge
diff --cc fs/open.c
Simple merge