Skip to content

Commit 1efff9a

Browse files
committed
Merge branch 'aufs5.3/11mmap' into aufs5.4/11mmap
2 parents 0dce812 + 84055d2 commit 1efff9a

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

fs/aufs/i_op.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,15 +1167,14 @@ static void au_refresh_iattr(struct inode *inode, struct kstat *st,
11671167
* returns zero or negative (an error).
11681168
* @dentry will be read-locked in success.
11691169
*/
1170-
int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
1171-
int locked)
1170+
int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
1171+
struct path *h_path, int locked)
11721172
{
11731173
int err;
11741174
unsigned int mnt_flags, sigen;
11751175
unsigned char udba_none;
11761176
aufs_bindex_t bindex;
11771177
struct super_block *sb, *h_sb;
1178-
struct inode *inode;
11791178

11801179
h_path->mnt = NULL;
11811180
h_path->dentry = NULL;
@@ -1216,7 +1215,11 @@ int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
12161215
di_read_lock_child(dentry, AuLock_IR);
12171216

12181217
body:
1219-
inode = d_inode(dentry);
1218+
if (!inode) {
1219+
inode = d_inode(dentry);
1220+
if (unlikely(!inode))
1221+
goto out;
1222+
}
12201223
bindex = au_ibtop(inode);
12211224
h_path->mnt = au_sbr_mnt(sb, bindex);
12221225
h_sb = h_path->mnt->mnt_sb;
@@ -1256,7 +1259,8 @@ static int aufs_getattr(const struct path *path, struct kstat *st,
12561259
err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
12571260
if (unlikely(err))
12581261
goto out;
1259-
err = au_h_path_getattr(dentry, /*force*/0, &h_path, /*locked*/0);
1262+
err = au_h_path_getattr(dentry, /*inode*/NULL, /*force*/0, &h_path,
1263+
/*locked*/0);
12601264
if (unlikely(err))
12611265
goto out_si;
12621266
if (unlikely(!h_path.dentry))

fs/aufs/inode.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ struct au_icpup_args {
194194
int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia,
195195
struct au_icpup_args *a);
196196

197-
int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
198-
int locked);
197+
int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
198+
struct path *h_path, int locked);
199199

200200
/* i_op_add.c */
201201
int au_may_add(struct dentry *dentry, aufs_bindex_t bindex,

fs/aufs/xattr.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int au_cpup_xattr(struct dentry *h_dst, struct dentry *h_src, int ignore_flags,
181181

182182
static int au_smack_reentering(struct super_block *sb)
183183
{
184-
#if IS_ENABLED(CONFIG_SECURITY_SMACK)
184+
#if IS_ENABLED(CONFIG_SECURITY_SMACK) || IS_ENABLED(CONFIG_SECURITY_SELINUX)
185185
/*
186186
* as a part of lookup, smack_d_instantiate() is called, and it calls
187187
* i_op->getxattr(). ouch.
@@ -212,7 +212,8 @@ struct au_lgxattr {
212212
} u;
213213
};
214214

215-
static ssize_t au_lgxattr(struct dentry *dentry, struct au_lgxattr *arg)
215+
static ssize_t au_lgxattr(struct dentry *dentry, struct inode *inode,
216+
struct au_lgxattr *arg)
216217
{
217218
ssize_t err;
218219
int reenter;
@@ -226,7 +227,7 @@ static ssize_t au_lgxattr(struct dentry *dentry, struct au_lgxattr *arg)
226227
if (unlikely(err))
227228
goto out;
228229
}
229-
err = au_h_path_getattr(dentry, /*force*/1, &h_path, reenter);
230+
err = au_h_path_getattr(dentry, inode, /*force*/1, &h_path, reenter);
230231
if (unlikely(err))
231232
goto out_si;
232233
if (unlikely(!h_path.dentry))
@@ -268,11 +269,10 @@ ssize_t aufs_listxattr(struct dentry *dentry, char *list, size_t size)
268269
},
269270
};
270271

271-
return au_lgxattr(dentry, &arg);
272+
return au_lgxattr(dentry, /*inode*/NULL, &arg);
272273
}
273274

274-
static ssize_t au_getxattr(struct dentry *dentry,
275-
struct inode *inode __maybe_unused,
275+
static ssize_t au_getxattr(struct dentry *dentry, struct inode *inode,
276276
const char *name, void *value, size_t size)
277277
{
278278
struct au_lgxattr arg = {
@@ -284,7 +284,7 @@ static ssize_t au_getxattr(struct dentry *dentry,
284284
},
285285
};
286286

287-
return au_lgxattr(dentry, &arg);
287+
return au_lgxattr(dentry, inode, &arg);
288288
}
289289

290290
static int au_setxattr(struct dentry *dentry, struct inode *inode,

0 commit comments

Comments
 (0)