1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

Debugfs fix for 6.14-rc1

Here is a single debugfs fix from Al to resolve the reported regression
 in linux-next and in the driver-core tree.  It has been reported to fix
 the issue.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZ55HfQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykocACgqvoq+99sC6joNEqAuZZil/PU/1wAoNJtys1x
 3JTFgphXSjoyMBsmM96b
 =pRKD
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull debugfs fix from Greg KH:
 "Here is a single debugfs fix from Al to resolve a reported regression
  in the driver-core tree. It has been reported to fix the issue"

* tag 'driver-core-6.14-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  debugfs: Fix the missing initializations in __debugfs_file_get()
This commit is contained in:
Linus Torvalds 2025-02-01 10:04:29 -08:00
commit 8c198ffd63

View file

@ -94,6 +94,7 @@ static int __debugfs_file_get(struct dentry *dentry, enum dbgfs_get_mode mode)
fsd = d_fsd;
} else {
struct inode *inode = dentry->d_inode;
unsigned int methods = 0;
if (WARN_ON(mode == DBGFS_GET_ALREADY))
return -EINVAL;
@ -106,25 +107,28 @@ static int __debugfs_file_get(struct dentry *dentry, enum dbgfs_get_mode mode)
const struct debugfs_short_fops *ops;
ops = fsd->short_fops = DEBUGFS_I(inode)->short_fops;
if (ops->llseek)
fsd->methods |= HAS_LSEEK;
methods |= HAS_LSEEK;
if (ops->read)
fsd->methods |= HAS_READ;
methods |= HAS_READ;
if (ops->write)
fsd->methods |= HAS_WRITE;
methods |= HAS_WRITE;
fsd->real_fops = NULL;
} else {
const struct file_operations *ops;
ops = fsd->real_fops = DEBUGFS_I(inode)->real_fops;
if (ops->llseek)
fsd->methods |= HAS_LSEEK;
methods |= HAS_LSEEK;
if (ops->read)
fsd->methods |= HAS_READ;
methods |= HAS_READ;
if (ops->write)
fsd->methods |= HAS_WRITE;
methods |= HAS_WRITE;
if (ops->unlocked_ioctl)
fsd->methods |= HAS_IOCTL;
methods |= HAS_IOCTL;
if (ops->poll)
fsd->methods |= HAS_POLL;
methods |= HAS_POLL;
fsd->short_fops = NULL;
}
fsd->methods = methods;
refcount_set(&fsd->active_users, 1);
init_completion(&fsd->active_users_drained);
INIT_LIST_HEAD(&fsd->cancellations);