X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=fs%2Fnamei.c;h=95a881e0552b1d6ca6333a47ae7c006a9455b29b;hb=765092e4cdaa8439b969952ec4e6de3b84241f90;hp=d049d39726957292bdd825200c64e2f9e76211d1;hpb=90c90cda05aecf0f7c45f9f35384b31bba38455f;p=linux-2.6-microblaze.git diff --git a/fs/namei.c b/fs/namei.c index d049d3972695..95a881e0552b 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4089,7 +4089,9 @@ int vfs_unlink(struct user_namespace *mnt_userns, struct inode *dir, return -EPERM; inode_lock(target); - if (is_local_mountpoint(dentry)) + if (IS_SWAPFILE(target)) + error = -EPERM; + else if (is_local_mountpoint(dentry)) error = -EBUSY; else { error = security_inode_unlink(dir, dentry); @@ -4597,6 +4599,10 @@ int vfs_rename(struct renamedata *rd) else if (target) inode_lock(target); + error = -EPERM; + if (IS_SWAPFILE(source) || (target && IS_SWAPFILE(target))) + goto out; + error = -EBUSY; if (is_local_mountpoint(old_dentry) || is_local_mountpoint(new_dentry)) goto out;