Skip to content

Commit 9ea7460

Browse files
committed
Merge tag '9p-for-6.18-rc3-v2' of https://github.com/martinetd/linux
Pull 9pfs fix from Dominique Martinet: "Fix 9p cache=mmap regression by revert This reverts the problematic commit instead of trying to fix it in a rush" * tag '9p-for-6.18-rc3-v2' of https://github.com/martinetd/linux: Revert "fs/9p: Refresh metadata in d_revalidate for uncached mode too"
2 parents 552c507 + 43c36a5 commit 9ea7460

3 files changed

Lines changed: 4 additions & 22 deletions

File tree

fs/9p/vfs_dentry.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ static int __v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
6666
struct p9_fid *fid;
6767
struct inode *inode;
6868
struct v9fs_inode *v9inode;
69-
unsigned int cached;
7069

7170
if (flags & LOOKUP_RCU)
7271
return -ECHILD;
@@ -76,11 +75,7 @@ static int __v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
7675
goto out_valid;
7776

7877
v9inode = V9FS_I(inode);
79-
struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode);
80-
81-
cached = v9ses->cache & (CACHE_META | CACHE_LOOSE);
82-
83-
if (!cached || v9inode->cache_validity & V9FS_INO_INVALID_ATTR) {
78+
if (v9inode->cache_validity & V9FS_INO_INVALID_ATTR) {
8479
int retval;
8580
struct v9fs_session_info *v9ses;
8681

@@ -114,6 +109,7 @@ static int __v9fs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
114109
p9_debug(P9_DEBUG_VFS,
115110
"refresh inode: dentry = %pd (%p), got error %pe\n",
116111
dentry, dentry, ERR_PTR(retval));
112+
if (retval < 0)
117113
return retval;
118114
}
119115
}
@@ -150,8 +146,6 @@ const struct dentry_operations v9fs_cached_dentry_operations = {
150146
};
151147

152148
const struct dentry_operations v9fs_dentry_operations = {
153-
.d_revalidate = v9fs_lookup_revalidate,
154-
.d_weak_revalidate = __v9fs_lookup_revalidate,
155149
.d_release = v9fs_dentry_release,
156150
.d_unalias_trylock = v9fs_dentry_unalias_trylock,
157151
.d_unalias_unlock = v9fs_dentry_unalias_unlock,

fs/9p/vfs_inode.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,14 +1339,8 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode)
13391339
* Don't update inode if the file type is different
13401340
*/
13411341
umode = p9mode2unixmode(v9ses, st, &rdev);
1342-
if (inode_wrong_type(inode, umode)) {
1343-
/*
1344-
* Do this as a way of letting the caller know the inode should not
1345-
* be reused
1346-
*/
1347-
v9fs_invalidate_inode_attr(inode);
1342+
if (inode_wrong_type(inode, umode))
13481343
goto out;
1349-
}
13501344

13511345
/*
13521346
* We don't want to refresh inode->i_size,

fs/9p/vfs_inode_dotl.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,8 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode)
897897
/*
898898
* Don't update inode if the file type is different
899899
*/
900-
if (inode_wrong_type(inode, st->st_mode)) {
901-
/*
902-
* Do this as a way of letting the caller know the inode should not
903-
* be reused
904-
*/
905-
v9fs_invalidate_inode_attr(inode);
900+
if (inode_wrong_type(inode, st->st_mode))
906901
goto out;
907-
}
908902

909903
/*
910904
* We don't want to refresh inode->i_size,

0 commit comments

Comments
 (0)