lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 5 Oct 2013 17:40:32 -0700
From:	Greg KH <gregkh@...uxfoundation.org>
To:	Tejun Heo <tj@...nel.org>
Cc:	kay@...y.org, linux-kernel@...r.kernel.org, ebiederm@...ssion.com,
	bhelgaas@...gle.com
Subject: Re: [PATCHSET v2] sysfs: use seq_file and unify regular and bin file
 handling

On Tue, Oct 01, 2013 at 05:41:54PM -0400, Tejun Heo wrote:
> Hello,
> 
> Changes from the last take[L] are,
> 
> * bin file reads no longer go through seq_file.  It goes through a
>   separate read path implemented in sysfs_bin_read().  bin files
>   shouldn't see any behavior difference now.
> 
> * bin files now use a separate file_operations struct -
>   sysfs_bin_operations.  Open and write paths are still shared but
>   read path is separate and mmap exists only for the bin files.  While
>   this is less uniform than before, it should still render itself well
>   to extracting the core functionality.
> 
> * 0001-0008 are the same as before.

Nice, I've applied all of these now.

> Patchset description follows.
> 
> Currently, sysfs's file handling is a bit weird.
> 
> * Regular and bin file paths are similar but implemented completely
>   separately duplicating some hairy logics.
> 
> * Read path implements custom buffering which is essentially
>   degenerate seq_file.
> 
> In addition, sysfs core implementation is planned to be separated out
> so that it can be shared by other subsystems and the current file
> handling is too restrictive and quirky to spread further to other
> parts of the kernel.  It'd be a lot more desirable to have read path
> completely handled by seq_file which is a lot more versatile and would
> also increase overall behavior consistency.
> 
> This patchset updates file handling such that read is handled by
> seq_file and then merges bin file handling into regular file path.
> While some changes introduces behavior changes in extreme corner
> cases, they are highly unlikely to be noticeable (please refer to the
> description of each patch for details) and generally bring sysfs's
> behavior closer to those of procfs or any pseudo filesystem which
> makes use of seq_file.
> 
> After the conversion, LOC is reduced by ~150 lines and read path is
> fully handled by seq_file, which allows defining a new seq_file based
> core interface which will enable sharing sysfs from other subsystems.

I'm glad to see the sysfs cleanups, thanks for doing all of this, it's
much needed.

How are you going to use sysfs from another kernel subsystem?  Is this
for another filesystem, or do you want to use kobjects for some other
subsystem that doesn't export them using sysfs?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ