mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
\n
-----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEq1nRK9aeMoq1VSgcnJ2qBz9kQNkFAl0LhAIACgkQnJ2qBz9k QNnUqwf/d7fNZv0+GJVBIrIVbSUgHqzJYxakMWAS6NGMmd2fkPcoPRHitXWbi5MJ fhJPFceNVqY30RPQUePlDmWSitEDI0kdaNZ3Z8SzE9YszaEgoLNAN/dpOuPGpQfh kXQd7yM1cBZJoAv5kQsECiYXfY7nk+3J+DVsu69rBcsooxT5rfXs00Dz9ETao9gK L1SR/s5C6b2t0m0EfQpv/+PjbzPQPLKngvihvFesAT6lSA6QpRMY7M8+4Es3rzuI 7h0kuThkJaIp9B+D9C8vYIT+uVQVjsN9wXozJHXRNvnK/4mfDvYJdWSkRhqP5p1a DBRo/jK8meV1ZvIEsLjARxHg0z7yAA== =PlCd -----END PGP SIGNATURE----- Merge tag 'for_v5.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull two misc vfs fixes from Jan Kara: "One small quota fix fixing spurious EDQUOT errors and one fanotify fix fixing a bug in the new fanotify FID reporting code" * tag 'for_v5.2-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: update connector fsid cache on add mark quota: fix a problem about transfer quota
This commit is contained in:
commit
d72558b2b3
4 changed files with 20 additions and 6 deletions
|
@ -355,6 +355,10 @@ static __kernel_fsid_t fanotify_get_fsid(struct fsnotify_iter_info *iter_info)
|
||||||
/* Mark is just getting destroyed or created? */
|
/* Mark is just getting destroyed or created? */
|
||||||
if (!conn)
|
if (!conn)
|
||||||
continue;
|
continue;
|
||||||
|
if (!(conn->flags & FSNOTIFY_CONN_FLAG_HAS_FSID))
|
||||||
|
continue;
|
||||||
|
/* Pairs with smp_wmb() in fsnotify_add_mark_list() */
|
||||||
|
smp_rmb();
|
||||||
fsid = conn->fsid;
|
fsid = conn->fsid;
|
||||||
if (WARN_ON_ONCE(!fsid.val[0] && !fsid.val[1]))
|
if (WARN_ON_ONCE(!fsid.val[0] && !fsid.val[1]))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -482,10 +482,13 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
|
||||||
conn->type = type;
|
conn->type = type;
|
||||||
conn->obj = connp;
|
conn->obj = connp;
|
||||||
/* Cache fsid of filesystem containing the object */
|
/* Cache fsid of filesystem containing the object */
|
||||||
if (fsid)
|
if (fsid) {
|
||||||
conn->fsid = *fsid;
|
conn->fsid = *fsid;
|
||||||
else
|
conn->flags = FSNOTIFY_CONN_FLAG_HAS_FSID;
|
||||||
|
} else {
|
||||||
conn->fsid.val[0] = conn->fsid.val[1] = 0;
|
conn->fsid.val[0] = conn->fsid.val[1] = 0;
|
||||||
|
conn->flags = 0;
|
||||||
|
}
|
||||||
if (conn->type == FSNOTIFY_OBJ_TYPE_INODE)
|
if (conn->type == FSNOTIFY_OBJ_TYPE_INODE)
|
||||||
inode = igrab(fsnotify_conn_inode(conn));
|
inode = igrab(fsnotify_conn_inode(conn));
|
||||||
/*
|
/*
|
||||||
|
@ -560,7 +563,12 @@ static int fsnotify_add_mark_list(struct fsnotify_mark *mark,
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
goto restart;
|
goto restart;
|
||||||
} else if (fsid && (conn->fsid.val[0] || conn->fsid.val[1]) &&
|
} else if (fsid && !(conn->flags & FSNOTIFY_CONN_FLAG_HAS_FSID)) {
|
||||||
|
conn->fsid = *fsid;
|
||||||
|
/* Pairs with smp_rmb() in fanotify_get_fsid() */
|
||||||
|
smp_wmb();
|
||||||
|
conn->flags |= FSNOTIFY_CONN_FLAG_HAS_FSID;
|
||||||
|
} else if (fsid && (conn->flags & FSNOTIFY_CONN_FLAG_HAS_FSID) &&
|
||||||
(fsid->val[0] != conn->fsid.val[0] ||
|
(fsid->val[0] != conn->fsid.val[0] ||
|
||||||
fsid->val[1] != conn->fsid.val[1])) {
|
fsid->val[1] != conn->fsid.val[1])) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1996,8 +1996,8 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
|
||||||
&warn_to[cnt]);
|
&warn_to[cnt]);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto over_quota;
|
goto over_quota;
|
||||||
ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0,
|
ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space,
|
||||||
&warn_to[cnt]);
|
DQUOT_SPACE_WARN, &warn_to[cnt]);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
spin_lock(&transfer_to[cnt]->dq_dqb_lock);
|
spin_lock(&transfer_to[cnt]->dq_dqb_lock);
|
||||||
dquot_decr_inodes(transfer_to[cnt], inode_usage);
|
dquot_decr_inodes(transfer_to[cnt], inode_usage);
|
||||||
|
|
|
@ -292,7 +292,9 @@ typedef struct fsnotify_mark_connector __rcu *fsnotify_connp_t;
|
||||||
*/
|
*/
|
||||||
struct fsnotify_mark_connector {
|
struct fsnotify_mark_connector {
|
||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
unsigned int type; /* Type of object [lock] */
|
unsigned short type; /* Type of object [lock] */
|
||||||
|
#define FSNOTIFY_CONN_FLAG_HAS_FSID 0x01
|
||||||
|
unsigned short flags; /* flags [lock] */
|
||||||
__kernel_fsid_t fsid; /* fsid of filesystem containing object */
|
__kernel_fsid_t fsid; /* fsid of filesystem containing object */
|
||||||
union {
|
union {
|
||||||
/* Object pointer [lock] */
|
/* Object pointer [lock] */
|
||||||
|
|
Loading…
Reference in a new issue