Skip to content

Commit 679330e

Browse files
João Paredeskleikamp
authored andcommitted
JFS: always load filesystem UUID during mount
The filesystem UUID was only being loaded into super_block sb when an external journal device was in use. When mounting without an external journal, the UUID remained unset, which prevented the computation of a filesystem ID (fsid), which could be confirmed via `stat -f -c "%i"` and thus user space could not use fanotify correctly. A missing filesystem ID causes fanotify to return ENODEV when marking the filesystem for events like FAN_CREATE, FAN_DELETE, FAN_MOVED_TO, and FAN_MOVED_FROM. As a result, applications relying on fanotify could not monitor these events on JFS filesystems without an external journal. Moved the UUID initialization so it is always performed during mount, ensuring the superblock UUID is consistently available. Signed-off-by: João Paredes <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]>
1 parent ca5848a commit 679330e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/jfs/jfs_mount.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,12 @@ static int chkSuper(struct super_block *sb)
378378
sbi->nbperpage = PSIZE >> sbi->l2bsize;
379379
sbi->l2nbperpage = L2PSIZE - sbi->l2bsize;
380380
sbi->l2niperblk = sbi->l2bsize - L2DISIZE;
381+
uuid_copy(&sbi->uuid, &j_sb->s_uuid);
382+
381383
if (sbi->mntflag & JFS_INLINELOG)
382384
sbi->logpxd = j_sb->s_logpxd;
383385
else {
384386
sbi->logdev = new_decode_dev(le32_to_cpu(j_sb->s_logdev));
385-
uuid_copy(&sbi->uuid, &j_sb->s_uuid);
386387
uuid_copy(&sbi->loguuid, &j_sb->s_loguuid);
387388
}
388389
sbi->fsckpxd = j_sb->s_fsckpxd;

0 commit comments

Comments
 (0)