Skip to content

Commit a1c5566

Browse files
committed
Merge branch 'aufs5.1/00base' into aufs5.2/00base
2 parents bdaa9c7 + 22720e5 commit a1c5566

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
@@ -1170,15 +1170,14 @@ static void au_refresh_iattr(struct inode *inode, struct kstat *st,
11701170
* returns zero or negative (an error).
11711171
* @dentry will be read-locked in success.
11721172
*/
1173-
int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
1174-
int locked)
1173+
int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
1174+
struct path *h_path, int locked)
11751175
{
11761176
int err;
11771177
unsigned int mnt_flags, sigen;
11781178
unsigned char udba_none;
11791179
aufs_bindex_t bindex;
11801180
struct super_block *sb, *h_sb;
1181-
struct inode *inode;
11821181

11831182
h_path->mnt = NULL;
11841183
h_path->dentry = NULL;
@@ -1219,7 +1218,11 @@ int au_h_path_getattr(struct dentry *dentry, int force, struct path *h_path,
12191218
di_read_lock_child(dentry, AuLock_IR);
12201219

12211220
body:
1222-
inode = d_inode(dentry);
1221+
if (!inode) {
1222+
inode = d_inode(dentry);
1223+
if (unlikely(!inode))
1224+
goto out;
1225+
}
12231226
bindex = au_ibtop(inode);
12241227
h_path->mnt = au_sbr_mnt(sb, bindex);
12251228
h_sb = h_path->mnt->mnt_sb;
@@ -1259,7 +1262,8 @@ static int aufs_getattr(const struct path *path, struct kstat *st,
12591262
err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
12601263
if (unlikely(err))
12611264
goto out;
1262-
err = au_h_path_getattr(dentry, /*force*/0, &h_path, /*locked*/0);
1265+
err = au_h_path_getattr(dentry, /*inode*/NULL, /*force*/0, &h_path,
1266+
/*locked*/0);
12631267
if (unlikely(err))
12641268
goto out_si;
12651269
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)