Merge tag 'fs_for_v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Jul 2021 19:06:39 +0000 (12:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 1 Jul 2021 19:06:39 +0000 (12:06 -0700)
Pull misc fs updates from Jan Kara:
 "The new quotactl_fd() syscall (remake of quotactl_path() syscall that
  got introduced & disabled in 5.13 cycle), and couple of udf, reiserfs,
  isofs, and writeback fixes and cleanups"

* tag 'fs_for_v5.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  writeback: fix obtain a reference to a freeing memcg css
  quota: remove unnecessary oom message
  isofs: remove redundant continue statement
  quota: Wire up quotactl_fd syscall
  quota: Change quotactl_path() systcall to an fd-based one
  reiserfs: Remove unneed check in reiserfs_write_full_page()
  udf: Fix NULL pointer dereference in udf_symlink function
  reiserfs: add check for invalid 1st journal block

27 files changed:
arch/alpha/kernel/syscalls/syscall.tbl
arch/arm/tools/syscall.tbl
arch/arm64/include/asm/unistd32.h
arch/ia64/kernel/syscalls/syscall.tbl
arch/m68k/kernel/syscalls/syscall.tbl
arch/microblaze/kernel/syscalls/syscall.tbl
arch/mips/kernel/syscalls/syscall_n32.tbl
arch/mips/kernel/syscalls/syscall_n64.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/parisc/kernel/syscalls/syscall.tbl
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/kernel/syscalls/syscall.tbl
arch/sh/kernel/syscalls/syscall.tbl
arch/sparc/kernel/syscalls/syscall.tbl
arch/x86/entry/syscalls/syscall_32.tbl
arch/x86/entry/syscalls/syscall_64.tbl
arch/xtensa/kernel/syscalls/syscall.tbl
fs/fs-writeback.c
fs/isofs/dir.c
fs/quota/quota.c
fs/quota/quota_tree.c
fs/reiserfs/inode.c
fs/reiserfs/journal.c
fs/udf/namei.c
include/linux/syscalls.h
include/uapi/asm-generic/unistd.h
kernel/sys_ni.c

index 3000a2e8ee21734d1759f2f4b208f5e68e63d4a3..a17687ed4b519a9827ec16a1ae9a9e8afb491f65 100644 (file)
 550    common  process_madvise                 sys_process_madvise
 551    common  epoll_pwait2                    sys_epoll_pwait2
 552    common  mount_setattr                   sys_mount_setattr
-# 553 reserved for quotactl_path
+553    common  quotactl_fd                     sys_quotactl_fd
 554    common  landlock_create_ruleset         sys_landlock_create_ruleset
 555    common  landlock_add_rule               sys_landlock_add_rule
 556    common  landlock_restrict_self          sys_landlock_restrict_self
index 28e03b5fec0044da777eaf5fa8efc5f3a6e87df4..c5df1179fc5d0a3d3ab1b0b27dc4b86063c64abd 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 5dab69d2c22bf2074acee8be2df2e25c9521ab39..99ffcafc736ca988b5e21d5bad863cd16263ca85 100644 (file)
@@ -893,7 +893,8 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
 __SYSCALL(__NR_epoll_pwait2, compat_sys_epoll_pwait2)
 #define __NR_mount_setattr 442
 __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
-/* 443 is reserved for quotactl_path */
+#define __NR_quotactl_fd 443
+__SYSCALL(__NR_quotactl_fd, sys_quotactl_fd)
 #define __NR_landlock_create_ruleset 444
 __SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
 #define __NR_landlock_add_rule 445
index bb11fe4c875af9c4b03362bc8e15310bab2da3d5..6d07742c57b88f60243c6c3450f05abd4b7bfa4c 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 79c2d24c89ddade58fc6161c1d917edc0df11768..541bc1b3a8f95a7571382d7f2daec0cef913bc4f 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index b11395a20c203769a55bc32b97e84d5c389206d1..a176faca2927d7254fe22af6dbabbba81ae85c51 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 9220909526f9b2246951e69f447abc6f2c4df04d..c2d2e19abea8e981d203cc586a85c51f250ec53a 100644 (file)
 440    n32     process_madvise                 sys_process_madvise
 441    n32     epoll_pwait2                    compat_sys_epoll_pwait2
 442    n32     mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    n32     quotactl_fd                     sys_quotactl_fd
 444    n32     landlock_create_ruleset         sys_landlock_create_ruleset
 445    n32     landlock_add_rule               sys_landlock_add_rule
 446    n32     landlock_restrict_self          sys_landlock_restrict_self
index 9cd1c34f31b5040434060a7b242be5946bd5c988..ac653d08b1ea11fa5ab1b844a83353d57bb2d736 100644 (file)
 440    n64     process_madvise                 sys_process_madvise
 441    n64     epoll_pwait2                    sys_epoll_pwait2
 442    n64     mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    n64     quotactl_fd                     sys_quotactl_fd
 444    n64     landlock_create_ruleset         sys_landlock_create_ruleset
 445    n64     landlock_add_rule               sys_landlock_add_rule
 446    n64     landlock_restrict_self          sys_landlock_restrict_self
index d560c467a8c697b8e01bc4d66910d2a15bb27d37..253f2cd70b6bac2aa750d55eec7d810df9733e85 100644 (file)
 440    o32     process_madvise                 sys_process_madvise
 441    o32     epoll_pwait2                    sys_epoll_pwait2                compat_sys_epoll_pwait2
 442    o32     mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    o32     quotactl_fd                     sys_quotactl_fd
 444    o32     landlock_create_ruleset         sys_landlock_create_ruleset
 445    o32     landlock_add_rule               sys_landlock_add_rule
 446    o32     landlock_restrict_self          sys_landlock_restrict_self
index aabc37f8cae3a4248433cbbbb2af139badf75aa2..e26187b9ab87b69d94b83d9aec61c71c08e9c9f0 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2                compat_sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 8f052ff4058ce5534327ea64550af52bff5f5de2..aef2a290e71a31bdf9011266b5110aec1b7b32b3 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2                compat_sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 0690263df1dd0b58268941074441cb4e820744bc..64d51ab5a8b459bf0422060f04b2002c88927865 100644 (file)
 440  common    process_madvise         sys_process_madvise             sys_process_madvise
 441  common    epoll_pwait2            sys_epoll_pwait2                compat_sys_epoll_pwait2
 442  common    mount_setattr           sys_mount_setattr               sys_mount_setattr
-# 443 reserved for quotactl_path
+443  common    quotactl_fd             sys_quotactl_fd                 sys_quotactl_fd
 444  common    landlock_create_ruleset sys_landlock_create_ruleset     sys_landlock_create_ruleset
 445  common    landlock_add_rule       sys_landlock_add_rule           sys_landlock_add_rule
 446  common    landlock_restrict_self  sys_landlock_restrict_self      sys_landlock_restrict_self
index 0b91499ebdcfc2f67dfd597a66186cfea4d64280..e0a70be77d848be5b4b236bd33e015290a439cb1 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index e34cc30ef22ced28c550699ab9973ac6b955a90e..603f5a821502843e12c8912888b439a08bcc192e 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2                compat_sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 4bbc267fb36bb9c8d07df4d4bd0b773f6bb1dc34..fba2f615119a26d29b96777e4c1da84faf85caea 100644 (file)
 440    i386    process_madvise         sys_process_madvise
 441    i386    epoll_pwait2            sys_epoll_pwait2                compat_sys_epoll_pwait2
 442    i386    mount_setattr           sys_mount_setattr
-# 443 reserved for quotactl_path
+443    i386    quotactl_fd             sys_quotactl_fd
 444    i386    landlock_create_ruleset sys_landlock_create_ruleset
 445    i386    landlock_add_rule       sys_landlock_add_rule
 446    i386    landlock_restrict_self  sys_landlock_restrict_self
index ce18119ea0d0f0c6deaf54959a9a7de1ed2e89ef..af973e400053de3fdc9b3cfa765b2be2b99cff8c 100644 (file)
 440    common  process_madvise         sys_process_madvise
 441    common  epoll_pwait2            sys_epoll_pwait2
 442    common  mount_setattr           sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd             sys_quotactl_fd
 444    common  landlock_create_ruleset sys_landlock_create_ruleset
 445    common  landlock_add_rule       sys_landlock_add_rule
 446    common  landlock_restrict_self  sys_landlock_restrict_self
index fd2f30227d961d7e356045142c1a8bb33044b269..235d67d6ceb45c576a1f564f564d56006f34a057 100644 (file)
 440    common  process_madvise                 sys_process_madvise
 441    common  epoll_pwait2                    sys_epoll_pwait2
 442    common  mount_setattr                   sys_mount_setattr
-# 443 reserved for quotactl_path
+443    common  quotactl_fd                     sys_quotactl_fd
 444    common  landlock_create_ruleset         sys_landlock_create_ruleset
 445    common  landlock_add_rule               sys_landlock_add_rule
 446    common  landlock_restrict_self          sys_landlock_restrict_self
index 8c7e9e51a3980e2915e74997cc34e5044b0eb3a5..06d04a74ab6c70ffa0441a2a70a77267ed9f0f34 100644 (file)
@@ -567,9 +567,14 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
        /* find and pin the new wb */
        rcu_read_lock();
        memcg_css = css_from_id(new_wb_id, &memory_cgrp_subsys);
-       if (memcg_css)
-               isw->new_wb = wb_get_create(bdi, memcg_css, GFP_ATOMIC);
+       if (memcg_css && !css_tryget(memcg_css))
+               memcg_css = NULL;
        rcu_read_unlock();
+       if (!memcg_css)
+               goto out_free;
+
+       isw->new_wb = wb_get_create(bdi, memcg_css, GFP_ATOMIC);
+       css_put(memcg_css);
        if (!isw->new_wb)
                goto out_free;
 
index b9e6a7ec78be42dac08e7c77e188ca6bb78f4ffc..eb2f8273e6f15e4575d7985024bd97a0f8e0de3a 100644 (file)
@@ -235,8 +235,6 @@ static int do_isofs_readdir(struct inode *inode, struct file *file,
                                break;
                }
                ctx->pos += de_len;
-
-               continue;
        }
        if (bh)
                brelse(bh);
index 05e4bd9ab6d68dc05aacefa6d5427f87431ca2b4..2bcc9a6f1bfc0dc5af05c6c6f81608664a09aca5 100644 (file)
@@ -968,31 +968,30 @@ out:
        return ret;
 }
 
-SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
-               mountpoint, qid_t, id, void __user *, addr)
+SYSCALL_DEFINE4(quotactl_fd, unsigned int, fd, unsigned int, cmd,
+               qid_t, id, void __user *, addr)
 {
        struct super_block *sb;
-       struct path mountpath;
        unsigned int cmds = cmd >> SUBCMDSHIFT;
        unsigned int type = cmd & SUBCMDMASK;
+       struct fd f;
        int ret;
 
-       if (type >= MAXQUOTAS)
-               return -EINVAL;
+       f = fdget_raw(fd);
+       if (!f.file)
+               return -EBADF;
 
-       ret = user_path_at(AT_FDCWD, mountpoint,
-                            LOOKUP_FOLLOW | LOOKUP_AUTOMOUNT, &mountpath);
-       if (ret)
-               return ret;
-
-       sb = mountpath.mnt->mnt_sb;
+       ret = -EINVAL;
+       if (type >= MAXQUOTAS)
+               goto out;
 
        if (quotactl_cmd_write(cmds)) {
-               ret = mnt_want_write(mountpath.mnt);
+               ret = mnt_want_write(f.file->f_path.mnt);
                if (ret)
                        goto out;
        }
 
+       sb = f.file->f_path.mnt->mnt_sb;
        if (quotactl_cmd_onoff(cmds))
                down_write(&sb->s_umount);
        else
@@ -1006,9 +1005,8 @@ SYSCALL_DEFINE4(quotactl_path, unsigned int, cmd, const char __user *,
                up_read(&sb->s_umount);
 
        if (quotactl_cmd_write(cmds))
-               mnt_drop_write(mountpath.mnt);
+               mnt_drop_write(f.file->f_path.mnt);
 out:
-       path_put(&mountpath);
-
+       fdput(f);
        return ret;
 }
index c5562c871c8beff8e12bb92dfa75b1066e3ff3fc..d3e995e1046fb317172a14c3ae6d5ca874fb5f3d 100644 (file)
@@ -47,15 +47,6 @@ static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
               / info->dqi_entry_size;
 }
 
-static char *getdqbuf(size_t size)
-{
-       char *buf = kmalloc(size, GFP_NOFS);
-       if (!buf)
-               printk(KERN_WARNING
-                      "VFS: Not enough memory for quota buffers.\n");
-       return buf;
-}
-
 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
 {
        struct super_block *sb = info->dqi_sb;
@@ -83,7 +74,7 @@ static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
 /* Remove empty block from list and return it */
 static int get_free_dqblk(struct qtree_mem_dqinfo *info)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
        int ret, blk;
 
@@ -132,7 +123,7 @@ static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk)
 static int remove_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
                               uint blk)
 {
-       char *tmpbuf = getdqbuf(info->dqi_usable_bs);
+       char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
        uint nextblk = le32_to_cpu(dh->dqdh_next_free);
        uint prevblk = le32_to_cpu(dh->dqdh_prev_free);
@@ -179,7 +170,7 @@ out_buf:
 static int insert_free_dqentry(struct qtree_mem_dqinfo *info, char *buf,
                               uint blk)
 {
-       char *tmpbuf = getdqbuf(info->dqi_usable_bs);
+       char *tmpbuf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf;
        int err;
 
@@ -227,7 +218,7 @@ static uint find_free_dqentry(struct qtree_mem_dqinfo *info,
 {
        uint blk, i;
        struct qt_disk_dqdbheader *dh;
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        char *ddquot;
 
        *err = 0;
@@ -298,7 +289,7 @@ out_buf:
 static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
                          uint *treeblk, int depth)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        int ret = 0, newson = 0, newact = 0;
        __le32 *ref;
        uint newblk;
@@ -375,7 +366,7 @@ int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
        int type = dquot->dq_id.type;
        struct super_block *sb = dquot->dq_sb;
        ssize_t ret;
-       char *ddquot = getdqbuf(info->dqi_entry_size);
+       char *ddquot = kmalloc(info->dqi_entry_size, GFP_NOFS);
 
        if (!ddquot)
                return -ENOMEM;
@@ -414,7 +405,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
                        uint blk)
 {
        struct qt_disk_dqdbheader *dh;
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        int ret = 0;
 
        if (!buf)
@@ -474,7 +465,7 @@ out_buf:
 static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
                       uint *blk, int depth)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        int ret = 0;
        uint newblk;
        __le32 *ref = (__le32 *)buf;
@@ -533,7 +524,7 @@ EXPORT_SYMBOL(qtree_delete_dquot);
 static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info,
                                 struct dquot *dquot, uint blk)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        loff_t ret = 0;
        int i;
        char *ddquot;
@@ -571,7 +562,7 @@ out_buf:
 static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info,
                                struct dquot *dquot, uint blk, int depth)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        loff_t ret = 0;
        __le32 *ref = (__le32 *)buf;
 
@@ -635,7 +626,7 @@ int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
                }
                dquot->dq_off = offset;
        }
-       ddquot = getdqbuf(info->dqi_entry_size);
+       ddquot = kmalloc(info->dqi_entry_size, GFP_NOFS);
        if (!ddquot)
                return -ENOMEM;
        ret = sb->s_op->quota_read(sb, type, ddquot, info->dqi_entry_size,
@@ -679,7 +670,7 @@ EXPORT_SYMBOL(qtree_release_dquot);
 static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id,
                        unsigned int blk, int depth)
 {
-       char *buf = getdqbuf(info->dqi_usable_bs);
+       char *buf = kmalloc(info->dqi_usable_bs, GFP_NOFS);
        __le32 *ref = (__le32 *)buf;
        ssize_t ret;
        unsigned int epb = info->dqi_usable_bs >> 2;
index 780bb90c1804b4aa5a0c799452079836dab6deb0..f49b72ccac4c0624adf70d2aa44f485d03b00e5e 100644 (file)
@@ -2584,9 +2584,7 @@ static int reiserfs_write_full_page(struct page *page,
                        clear_buffer_dirty(bh);
                        set_buffer_uptodate(bh);
                } else if ((checked || buffer_dirty(bh)) &&
-                          (!buffer_mapped(bh) || (buffer_mapped(bh)
-                                                      && bh->b_blocknr ==
-                                                      0))) {
+                          (!buffer_mapped(bh) || bh->b_blocknr == 0)) {
                        /*
                         * not mapped yet, or it points to a direct item, search
                         * the btree for the mapping info, and log any direct
index 9edc8e2b154e0f133eb0c91836b77f4371bcaecc..0834b101c316d18bb1f98b61ef4402c402745312 100644 (file)
@@ -2758,6 +2758,20 @@ int journal_init(struct super_block *sb, const char *j_dev_name,
                goto free_and_return;
        }
 
+       /*
+        * Sanity check to see if journal first block is correct.
+        * If journal first block is invalid it can cause
+        * zeroing important superblock members.
+        */
+       if (!SB_ONDISK_JOURNAL_DEVICE(sb) &&
+           SB_ONDISK_JOURNAL_1st_BLOCK(sb) < SB_JOURNAL_1st_RESERVED_BLOCK(sb)) {
+               reiserfs_warning(sb, "journal-1393",
+                                "journal 1st super block is invalid: 1st reserved block %d, but actual 1st block is %d",
+                                SB_JOURNAL_1st_RESERVED_BLOCK(sb),
+                                SB_ONDISK_JOURNAL_1st_BLOCK(sb));
+               goto free_and_return;
+       }
+
        if (journal_init_dev(sb, journal, j_dev_name) != 0) {
                reiserfs_warning(sb, "sh-462",
                                 "unable to initialize journal device");
index 3ae9f1e9198460c9e03a6841bc2fd99944f9f548..7c7c9bbbfa5719743a6caefedf6bbcb208ec7a50 100644 (file)
@@ -934,6 +934,10 @@ static int udf_symlink(struct user_namespace *mnt_userns, struct inode *dir,
                                iinfo->i_location.partitionReferenceNum,
                                0);
                epos.bh = udf_tgetblk(sb, block);
+               if (unlikely(!epos.bh)) {
+                       err = -ENOMEM;
+                       goto out_no_entry;
+               }
                lock_buffer(epos.bh);
                memset(epos.bh->b_data, 0x00, bsize);
                set_buffer_uptodate(epos.bh);
index 050511e8f1f8486448613db70521501af4c9ee4d..586128d5c3b86326b2761a6e33e082aa862905a7 100644 (file)
@@ -485,8 +485,8 @@ asmlinkage long sys_pipe2(int __user *fildes, int flags);
 /* fs/quota.c */
 asmlinkage long sys_quotactl(unsigned int cmd, const char __user *special,
                                qid_t id, void __user *addr);
-asmlinkage long sys_quotactl_path(unsigned int cmd, const char __user *mountpoint,
-                                 qid_t id, void __user *addr);
+asmlinkage long sys_quotactl_fd(unsigned int fd, unsigned int cmd, qid_t id,
+                               void __user *addr);
 
 /* fs/readdir.c */
 asmlinkage long sys_getdents64(unsigned int fd,
index d2a942086fcb6ef408de172395cdabf52dc5ad0b..f211961ce1da69ac38995531e22a411238be5233 100644 (file)
@@ -863,7 +863,8 @@ __SYSCALL(__NR_process_madvise, sys_process_madvise)
 __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2)
 #define __NR_mount_setattr 442
 __SYSCALL(__NR_mount_setattr, sys_mount_setattr)
-/* 443 is reserved for quotactl_path */
+#define __NR_quotactl_fd 443
+__SYSCALL(__NR_quotactl_fd, sys_quotactl_fd)
 
 #define __NR_landlock_create_ruleset 444
 __SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset)
index 0ea8128468c35176af45d8cc6ed22e1d496de463..dad4d994641e2153587e0fa6f2fb5f5e6dbf613e 100644 (file)
@@ -99,7 +99,7 @@ COND_SYSCALL(flock);
 
 /* fs/quota.c */
 COND_SYSCALL(quotactl);
-COND_SYSCALL(quotactl_path);
+COND_SYSCALL(quotactl_fd);
 
 /* fs/readdir.c */