summaryrefslogtreecommitdiffstats
path: root/fs/notify/mark.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-06-22 08:59:24 -0400
committerDavid S. Miller <davem@davemloft.net>2019-06-22 08:59:24 -0400
commit92ad6325cb891bb455487bfe90cc47d18aa6ec37 (patch)
tree433a7ef938fae69789216043f67eff9f9c6b0c68 /fs/notify/mark.c
parente0effb5fbd56a8b2b8917611cbf4fcd9aba92b8f (diff)
parentc356dc4b540edd6c02b409dd8cf3208ba2804c38 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Minor SPDX change conflict. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/notify/mark.c')
-rw-r--r--fs/notify/mark.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index 25eb247ea85a..99ddd126f6f0 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -482,10 +482,13 @@ static int fsnotify_attach_connector_to_object(fsnotify_connp_t *connp,
482 conn->type = type; 482 conn->type = type;
483 conn->obj = connp; 483 conn->obj = connp;
484 /* Cache fsid of filesystem containing the object */ 484 /* Cache fsid of filesystem containing the object */
485 if (fsid) 485 if (fsid) {
486 conn->fsid = *fsid; 486 conn->fsid = *fsid;
487 else 487 conn->flags = FSNOTIFY_CONN_FLAG_HAS_FSID;
488 } else {
488 conn->fsid.val[0] = conn->fsid.val[1] = 0; 489 conn->fsid.val[0] = conn->fsid.val[1] = 0;
490 conn->flags = 0;
491 }
489 if (conn->type == FSNOTIFY_OBJ_TYPE_INODE) 492 if (conn->type == FSNOTIFY_OBJ_TYPE_INODE)
490 inode = igrab(fsnotify_conn_inode(conn)); 493 inode = igrab(fsnotify_conn_inode(conn));
491 /* 494 /*
@@ -560,7 +563,12 @@ restart:
560 if (err) 563 if (err)
561 return err; 564 return err;
562 goto restart; 565 goto restart;
563 } else if (fsid && (conn->fsid.val[0] || conn->fsid.val[1]) && 566 } else if (fsid && !(conn->flags & FSNOTIFY_CONN_FLAG_HAS_FSID)) {
567 conn->fsid = *fsid;
568 /* Pairs with smp_rmb() in fanotify_get_fsid() */
569 smp_wmb();
570 conn->flags |= FSNOTIFY_CONN_FLAG_HAS_FSID;
571 } else if (fsid && (conn->flags & FSNOTIFY_CONN_FLAG_HAS_FSID) &&
564 (fsid->val[0] != conn->fsid.val[0] || 572 (fsid->val[0] != conn->fsid.val[0] ||
565 fsid->val[1] != conn->fsid.val[1])) { 573 fsid->val[1] != conn->fsid.val[1])) {
566 /* 574 /*