]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/inode.c
ext4: set h_journal if there is a failure starting a reserved handle
[mirror_ubuntu-bionic-kernel.git] / fs / inode.c
index 03102d6ef044d484ee9d7d1c9731437a4418d2c9..5c1138e9cac060ade60b613efb8ad1826b29ec84 100644 (file)
@@ -1655,7 +1655,7 @@ EXPORT_SYMBOL(generic_update_time);
  * This does the actual work of updating an inodes time or version.  Must have
  * had called mnt_want_write() before calling this.
  */
-static int update_time(struct inode *inode, struct timespec *time, int flags)
+int update_time(struct inode *inode, struct timespec *time, int flags)
 {
        int (*update_time)(struct inode *, struct timespec *, int);
 
@@ -1664,6 +1664,7 @@ static int update_time(struct inode *inode, struct timespec *time, int flags)
 
        return update_time(inode, time, flags);
 }
+EXPORT_SYMBOL_GPL(update_time);
 
 /**
  *     touch_atime     -       update the access time
@@ -1749,7 +1750,8 @@ EXPORT_SYMBOL(touch_atime);
  */
 int should_remove_suid(struct dentry *dentry)
 {
-       umode_t mode = d_inode(dentry)->i_mode;
+       struct inode *inode = d_inode(dentry);
+       umode_t mode = inode->i_mode;
        int kill = 0;
 
        /* suid always must be killed */
@@ -1763,7 +1765,8 @@ int should_remove_suid(struct dentry *dentry)
        if (unlikely((mode & S_ISGID) && (mode & S_IXGRP)))
                kill |= ATTR_KILL_SGID;
 
-       if (unlikely(kill && !capable(CAP_FSETID) && S_ISREG(mode)))
+       if (unlikely(kill && !capable_wrt_inode_uidgid(inode, CAP_FSETID) &&
+                    S_ISREG(mode)))
                return kill;
 
        return 0;