[Devel] [PATCH RHEL7 COMMIT] Revert "fs: use original vfsmount for touch_atime"

2019-10-22 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-1062.1.2.vz7.114.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.1.2.vz7.114.8
-->
commit 91d8c3e8a140fd53ae9b0a3840a8cb8a663bd10c
Author: Konstantin Khorenko 
Date:   Tue Oct 22 16:24:41 2019 +0300

Revert "fs: use original vfsmount for touch_atime"

This reverts commit c03ccabe433a3cf811477358975e9d0a4bd0c144.

The patch being reverted had been introduced in the scope of
https://jira.sw.ru/browse/PSBM-51009

Now it's reverted in the scope of
https://jira.sw.ru/browse/PSBM-78863

because Red Hat had backported 4bacc9c9234c ("overlayfs: Make f_path always
point to the overlay and f_inode to the underlay") long ago and now
xfstests should work fine on overlayfs (atime part).

Signed-off-by: Konstantin Khorenko 
---
 fs/file_table.c|  6 --
 fs/locks.c |  5 ++---
 fs/open.c  | 19 ++-
 include/linux/fs.h |  4 +---
 4 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/fs/file_table.c b/fs/file_table.c
index a8f4cffe2fee..6af525d158d1 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -243,8 +243,6 @@ static void __fput(struct file *file)
struct dentry *dentry = file->f_path.dentry;
struct vfsmount *mnt = file->f_path.mnt;
struct inode *inode = file->f_inode;
-   struct dentry *original_dentry = file->f_original_path.dentry;
-   struct vfsmount *original_mnt = file->f_original_path.mnt;
 
might_sleep();
 
@@ -276,14 +274,10 @@ static void __fput(struct file *file)
drop_file_write_access(file);
file->f_path.dentry = NULL;
file->f_path.mnt = NULL;
-   file->f_original_path.dentry = NULL;
-   file->f_original_path.mnt = NULL;
file->f_inode = NULL;
file_free(file);
dput(dentry);
mntput(mnt);
-   dput(original_dentry);
-   mntput(original_mnt);
 }
 
 static DEFINE_SPINLOCK(delayed_fput_lock);
diff --git a/fs/locks.c b/fs/locks.c
index cb5a3bc186f3..d1cf9a6d704d 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1590,9 +1590,8 @@ static int
 generic_add_lease(struct file *filp, long arg, struct file_lock **flp, void 
**priv)
 {
struct file_lock *fl, **before, **my_before = NULL, *lease;
-   struct dentry *dentry = filp->f_original_path.mnt ?
-   filp->f_original_path.dentry: filp->f_path.dentry;
-   struct inode *inode = filp->f_path.dentry->d_inode;
+   struct dentry *dentry = filp->f_path.dentry;
+   struct inode *inode = dentry->d_inode;
bool is_deleg = (*flp)->fl_flags & FL_DELEG;
int error;
 
diff --git a/fs/open.c b/fs/open.c
index ddff043ac1e2..c67314449385 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -900,17 +900,9 @@ int vfs_open(const struct path *path, struct file *filp,
 {
struct inode *inode = path->dentry->d_inode;
iop_dentry_open_t dentry_open = get_dentry_open_iop(inode);
-   int do_cleanup = 0;
-   int ret;
-
-   if (!filp->f_original_path.mnt && dentry_open) {
-   filp->f_original_path = *path;
-   path_get(>f_original_path);
-   do_cleanup = 1;
-   }
 
if (dentry_open)
-   ret = dentry_open(path->dentry, filp, cred);
+   return dentry_open(path->dentry, filp, cred);
else {
struct dentry *dentry = d_real(path->dentry, NULL, 
filp->f_flags, 0);
 
@@ -918,15 +910,8 @@ int vfs_open(const struct path *path, struct file *filp,
return PTR_ERR(dentry);
 
filp->f_path = *path;
-   ret = do_dentry_open(filp, dentry->d_inode, NULL, cred);
+   return do_dentry_open(filp, dentry->d_inode, NULL, cred);
}
-
-   if (ret && do_cleanup) {
-   path_put(>f_original_path);
-   filp->f_original_path.mnt = NULL;
-   filp->f_original_path.dentry = NULL;
-   }
-   return ret;
 }
 EXPORT_SYMBOL(vfs_open);
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2ba9c5176980..0b074aa9d8c6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1059,7 +1059,6 @@ struct file {
struct rcu_head fu_rcuhead;
} f_u;
struct path f_path;
-   struct path f_original_path;
 #define f_dentry   f_path.dentry
struct inode*f_inode;   /* cached value */
const struct file_operations*f_op;
@@ -2345,8 +2344,7 @@ extern void touch_atime(struct path *);
 static inline void file_accessed(struct file *file)
 {
if (!(file->f_flags & O_NOATIME))
-   touch_atime(file->f_original_path.mnt ?
-   >f_original_path : >f_path);
+   touch_atime(>f_path);
 }
 
 int sync_inode(struct inode *inode, struct writeback_control *wbc);

___
Devel 

Re: [Devel] [PATCH RHEL7 COMMIT] Revert "fs: use original vfsmount for touch_atime"

2016-09-23 Thread Konstantin Khorenko

reapplied in rh7-3.10.0-327.28.2.vz7.17.10

--
Best regards,

Konstantin Khorenko,
Virtuozzo Linux Kernel Team

On 09/21/2016 04:52 PM, Konstantin Khorenko wrote:

The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.8
-->
commit 5ca9c58d75751a11522dd129ddeb5a894a227896
Author: Konstantin Khorenko 
Date:   Wed Sep 21 17:51:42 2016 +0400

Revert "fs: use original vfsmount for touch_atime"

Temporary revert due to panic:
https://jira.sw.ru/browse/PSBM-52373

This reverts commit a427c4dfb7514de4701ad5f51e4f9442a495131c.
---
 fs/open.c  | 3 ---
 include/linux/fs.h | 4 +---
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 8c066b1..bc60c05 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -894,9 +894,6 @@ int vfs_open(const struct path *path, struct file *filp,
struct inode *inode = path->dentry->d_inode;
iop_dentry_open_t dentry_open = get_dentry_open_iop(inode);

-   if (!filp->f_original_path.mnt)
-   filp->f_original_path = *path;
-
if (dentry_open)
return dentry_open(path->dentry, filp, cred);
else {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index ed9519f..7203dba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -959,7 +959,6 @@ struct file {
struct rcu_head fu_rcuhead;
} f_u;
struct path f_path;
-   struct path f_original_path;
 #define f_dentry   f_path.dentry
struct inode*f_inode;   /* cached value */
const struct file_operations*f_op;
@@ -2094,8 +2093,7 @@ extern void touch_atime(struct path *);
 static inline void file_accessed(struct file *file)
 {
if (!(file->f_flags & O_NOATIME))
-   touch_atime(file->f_original_path.mnt ?
-   >f_original_path : >f_path);
+   touch_atime(>f_path);
 }

 int sync_inode(struct inode *inode, struct writeback_control *wbc);
.


___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel


[Devel] [PATCH RHEL7 COMMIT] Revert "fs: use original vfsmount for touch_atime"

2016-09-21 Thread Konstantin Khorenko
The commit is pushed to "branch-rh7-3.10.0-327.28.2.vz7.17.x-ovz" and will 
appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.28.2.vz7.17.8
-->
commit 5ca9c58d75751a11522dd129ddeb5a894a227896
Author: Konstantin Khorenko 
Date:   Wed Sep 21 17:51:42 2016 +0400

Revert "fs: use original vfsmount for touch_atime"

Temporary revert due to panic:
https://jira.sw.ru/browse/PSBM-52373

This reverts commit a427c4dfb7514de4701ad5f51e4f9442a495131c.
---
 fs/open.c  | 3 ---
 include/linux/fs.h | 4 +---
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index 8c066b1..bc60c05 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -894,9 +894,6 @@ int vfs_open(const struct path *path, struct file *filp,
struct inode *inode = path->dentry->d_inode;
iop_dentry_open_t dentry_open = get_dentry_open_iop(inode);
 
-   if (!filp->f_original_path.mnt)
-   filp->f_original_path = *path;
-
if (dentry_open)
return dentry_open(path->dentry, filp, cred);
else {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index ed9519f..7203dba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -959,7 +959,6 @@ struct file {
struct rcu_head fu_rcuhead;
} f_u;
struct path f_path;
-   struct path f_original_path;
 #define f_dentry   f_path.dentry
struct inode*f_inode;   /* cached value */
const struct file_operations*f_op;
@@ -2094,8 +2093,7 @@ extern void touch_atime(struct path *);
 static inline void file_accessed(struct file *file)
 {
if (!(file->f_flags & O_NOATIME))
-   touch_atime(file->f_original_path.mnt ?
-   >f_original_path : >f_path);
+   touch_atime(>f_path);
 }
 
 int sync_inode(struct inode *inode, struct writeback_control *wbc);
___
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel