add patch add-fallocate-mode-blocking-for-debugging
[ext4-patch-queue.git] / remove-unnecessary-check-for-APPEND-and-IMMUTABLE
blobe69dfff23a4eca9e259dd0de01f9c4bca442c577
1 ext4: remove unnecessary check for APPEND and IMMUTABLE
3 From: Lukas Czerner <lczerner@redhat.com>
5 All the checks IS_APPEND and IS_IMMUTABLE for the fallocate operation on
6 the inode are done in vfs. No need to do this again in ext4. Remove it.
8 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
9 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
10 ---
11  fs/ext4/extents.c | 6 ------
12  fs/ext4/inode.c   | 6 +-----
13  2 files changed, 1 insertion(+), 11 deletions(-)
15 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
16 index 89f2227..0177150 100644
17 --- a/fs/ext4/extents.c
18 +++ b/fs/ext4/extents.c
19 @@ -5387,12 +5387,6 @@ int ext4_collapse_range(struct inode *inode, loff_t offset, loff_t len)
20         /* Take mutex lock */
21         mutex_lock(&inode->i_mutex);
23 -       /* It's not possible punch hole on append only file */
24 -       if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
25 -               ret = -EPERM;
26 -               goto out_mutex;
27 -       }
29         if (IS_SWAPFILE(inode)) {
30                 ret = -ETXTBSY;
31                 goto out_mutex;
32 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
33 index 1922f48..56f1ff4 100644
34 --- a/fs/ext4/inode.c
35 +++ b/fs/ext4/inode.c
36 @@ -3528,11 +3528,7 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
37         }
39         mutex_lock(&inode->i_mutex);
40 -       /* It's not possible punch hole on append only file */
41 -       if (IS_APPEND(inode) || IS_IMMUTABLE(inode)) {
42 -               ret = -EPERM;
43 -               goto out_mutex;
44 -       }
46         if (IS_SWAPFILE(inode)) {
47                 ret = -ETXTBSY;
48                 goto out_mutex;
49 -- 
50 1.8.3.1
53 To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
54 the body of a message to majordomo@vger.kernel.org
55 More majordomo info at  http://vger.kernel.org/majordomo-info.html