24 Jan, 2014
1 commit
-
We stick an extra svc_fh in nfsd3_readdirres to save the need to
kmalloc, though maybe it would be fine to kmalloc instead.Acked-by: Jeff Layton
Signed-off-by: J. Bruce Fields
09 Jan, 2014
1 commit
-
We can simplify the idmapping code if it does its own encoding and
returns nfs errors.Signed-off-by: J. Bruce Fields
08 Jan, 2014
5 commits
-
There's a simpler way to write this.
Signed-off-by: J. Bruce Fields
-
Remove some pointless goto's.
Signed-off-by: J. Bruce Fields
-
This confuses me every time.
Signed-off-by: J. Bruce Fields
-
As a temporary fix, nfsd was breaking all leases on unlink, link,
rename, and setattr.Now that we can distinguish between leases and delegations, we can be
nicer and break only the delegations, and not bother lease-holders with
operations they don't care about.And we get to delete some code while we're at it.
Note that in the presence of delegations the vfs calls here all return
-EWOULDBLOCK instead of blocking, so nfsd threads will not get stuck
waiting for delegation returns.Acked-by: Jeff Layton
Signed-off-by: J. Bruce Fields
07 Jan, 2014
7 commits
-
If failed after calling alloc_session but before init_session, nfsd will call __free_session to
free se_slots in session. But, session->se_fchannel.maxreqs is not initialized (value is zero).
So that, the memory malloced for slots will be lost in free_session_slots for maxreqs is zero.This path sets the information for channel in alloc_session after mallocing slots succeed,
instead in init_session.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
We can achieve the same result with a cmpxchg(). This also fixes a
potential race in use_gss_proxy(). The value of sn->use_gss_proxy could
go from -1 to 1 just after we check it in use_gss_proxy() but before we
acquire the spinlock. The procfile write would end up returning success
but the value would flip to 0 soon afterward. With this method we not
only avoid locking but the first "setter" always wins.Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields -
An nfsd thread can call use_gss_proxy and find it set to '1' but find
gssp_clnt still NULL, so that when it attempts the upcall the result
will be an unnecessary -EIO.So, ensure that gssp_clnt is created first, and set the use_gss_proxy
variable only if that succeeds.Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields -
It doesn't make much sense to make reads from this procfile hang. As
far as I can tell, only gssproxy itself will open this file and it
never reads from it. Change it to just give the present setting of
sn->use_gss_proxy without waiting for anything.Note that we do not want to call use_gss_proxy() in this codepath
since an inopportune read of this file could cause it to be disabled
prematurely.Cc: stable@vger.kernel.org
Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields -
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
Without CONFIG_NFSD_V3, compile will get warning as,
fs/nfsd/nfssvc.c: In function 'nfsd_svc':
>> fs/nfsd/nfssvc.c:246:60: warning: array subscript is above array bounds [-Warray-bounds]
return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL);
^Reported-by: kbuild test robot
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields
04 Jan, 2014
9 commits
-
When starting without nfsv2 and nfsv3, nfsd does not need to start
lockd (and certainly doesn't need to fail because lockd failed to
register with the portmapper).Reported-by: Gareth Williams
Reviewed-by: Chuck Lever
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
NFSv4 clients can contact port 2049 directly instead of needing the
portmapper.Therefore a failure to register to the portmapper when starting an
NFSv4-only server isn't really a problem.But Gareth Williams reports that an attempt to start an NFSv4-only
server without starting portmap fails:#rpc.nfsd -N 2 -N 3
rpc.nfsd: writing fd to kernel failed: errno 111 (Connection refused)
rpc.nfsd: unable to set any sockets for nfsdAdd a flag to svc_version to tell the rpc layer it can safely ignore an
rpcbind failure in the NFSv4-only case.Reported-by: Gareth Williams
Reviewed-by: Chuck Lever
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
the length for backchannel checking should be multiplied by sizeof(__be32).
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
check_forechannel_attrs gets drc memory, so nfsd must put it when
check_backchannel_attrs fails.After many requests with bad back channel attrs, nfsd will deny any
client's CREATE_SESSION forever.A new test case named CSESS29 for pynfs will send in another mail.
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
commit 5b6feee9608dce7afd2646f457c93e612526d1d8 forgot
recording the back channel attrs in nfsd4_session.nfsd just check the back channel attars by check_backchannel_attrs,
but do not record it in nfsd4_session in the latest kernel.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
Since defined in Linux-2.6.12-rc2, READTIME has not been used.
Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
host_err was only used for nfs4_acl_new.
This patch delete it, and return nfserr_jukebox directly.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
Get rid of the extra code, using nfsd4_encode_noop for encoding destroy_session and free_stateid.
And, delete unused argument (fr_status) int nfsd4_free_stateid.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
We should use XDR_LEN to calculate reserved space in case the oid is not
a multiple of 4.RESERVE_SPACE actually rounds up for us, but it's probably better to be
careful here.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields
03 Jan, 2014
2 commits
-
commit 557ce2646e775f6bda734dd92b10d4780874b9c7
"nfsd41: replace page based DRC with buffer based DRC"
have remove unused nfsd4_set_statp, but miss the function definition.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields -
commit 58cd57bfd9db3bc213bf9d6a10920f82095f0114
"nfsd: Fix SP4_MACH_CRED negotiation in EXCHANGE_ID"
miss calculating the length of bitmap for spo_must_enforce and spo_must_allow.Signed-off-by: Kinglong Mee
Signed-off-by: J. Bruce Fields
13 Dec, 2013
2 commits
-
There is an inconsistency in the handling of SUID/SGID file
bits after chown() between NFS and other local file systems.Local file systems (for example, ext3, ext4, xfs, btrfs) revoke
SUID/SGID bits after chown() on a regular file even if
the owner/group of the file has not been changed:~# touch file; chmod ug+s file; chmod u+x file
~# ls -l file
-rwsr-Sr-- 1 root root 0 Dec 6 04:49 file
~# chown root file; ls -l file
-rwxr-Sr-- 1 root root 0 Dec 6 04:49 filebut NFS doesn't do that:
~# touch file; chmod ug+s file; chmod u+x file
~# ls -l file
-rwsr-Sr-- 1 root root 0 Dec 6 04:49 file
~# chown root file; ls -l file
-rwsr-Sr-- 1 root root 0 Dec 6 04:49 fileNFS does that only if the owner/group has been changed:
~# touch file; chmod ug+s file; chmod u+x file
~# ls -l file
-rwsr-Sr-- 1 root root 0 Dec 6 05:02 file
~# chown bin file; ls -l file
-rwxr-Sr-- 1 bin root 0 Dec 6 05:02 fileSee: http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html
"If the specified file is a regular file, one or more of
the S_IXUSR, S_IXGRP, or S_IXOTH bits of the file mode are set,
and the process has appropriate privileges, it is
implementation-defined whether the set-user-ID and set-group-ID
bits are altered."So both variants are acceptable by POSIX.
This patch makes NFS to behave like local file systems.
Signed-off-by: Stanislav Kholmanskikh
Signed-off-by: J. Bruce Fields -
hex_pack_byte() is a fast way to convert a byte in its ASCII representation. We
may use it instead of custom approach.Signed-off-by: Andy Shevchenko
Signed-off-by: J. Bruce Fields
12 Dec, 2013
1 commit
-
Currently when we are processing a request, we try to scrape an expired
or over-limit entry off the list in preference to allocating a new one
from the slab.This is unnecessarily complicated. Just use the slab layer.
Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields
11 Dec, 2013
5 commits
-
Signed-off-by: Weng Meiling
Signed-off-by: J. Bruce Fields -
Signed-off-by: Christoph Hellwig
Signed-off-by: J. Bruce Fields -
The Linux NFS server replies among other things to a "Check access permission"
the following:NFS: File type = 2 (Directory)
NFS: Mode = 040755A netapp server replies here:
NFS: File type = 2 (Directory)
NFS: Mode = 0755The RFC 1813 i read:
fattr3struct fattr3 {
ftype3 type;
mode3 mode;
uint32 nlink;
...
For the mode bits only the lowest 9 are defined in the RFCAs far as I can tell, knfsd has always done this, so apparently it's harmless.
Nevertheless, it appears to be wrong.Note this is already correct in the NFSv4 case, only v2 and v3 need
fixing.Signed-off-by: J. Bruce Fields
-
This has gone a little stale.
Reported-by: Christoph Hellwig
Reviewed-by: Christoph Hellwig
Signed-off-by: J. Bruce Fields -
The DRC code will attempt to reuse an existing, expired cache entry in
preference to allocating a new one. It'll then search the cache, and if
it gets a hit it'll then free the cache entry that it was going to
reuse.The cache code doesn't unhash the entry that it's going to reuse
however, so it's possible for it end up designating an entry for reuse
and then subsequently freeing the same entry after it finds it. This
leads it to a later use-after-free situation and usually some list
corruption warnings or an oops.Fix this by simply unhashing the entry that we intend to reuse. That
will mean that it's not findable via a search and should prevent this
situation from occurring.Cc: stable@vger.kernel.org # v3.10+
Reported-by: Christoph Hellwig
Reported-by: g. artim
Signed-off-by: Jeff Layton
Signed-off-by: J. Bruce Fields
07 Dec, 2013
6 commits
-
…t/rostedt/linux-trace
Pull tracing fix from Steven Rostedt:
"A regression showed up that there's a large delay when enabling all
events. This was prevalent when FTRACE_SELFTEST was enabled which
enables all events several times, and caused the system bootup to
pause for over a minute.This was tracked down to an addition of a synchronize_sched()
performed when system call tracepoints are unregistered.The synchronize_sched() is needed between the unregistering of the
system call tracepoint and a deletion of a tracing instance buffer.
But placing the synchronize_sched() in the unreg of *every* system
call tracepoint is a bit overboard. A single synchronize_sched()
before the deletion of the instance is sufficient"* tag 'trace-fixes-3.13-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
tracing: Only run synchronize_sched() at instance deletion time -
Pull aio fix from Benjamin LaHaise:
"AIO fix from Gu Zheng that fixes a GPF that Dave Jones uncovered with
trinity"* git://git.kvack.org/~bcrl/aio-next:
aio: clean up aio ring in the fail path -
Pull SCSI fixes from James Bottomley:
"This is a set of nine fixes (and one author update).The libsas one should fix discovery in eSATA devices, the WRITE_SAME
one is the largest, but it should fix a lot of problems we've been
getting with the emulated RAID devices (they've been effectively lying
about support and then firmware has been choking on the commands).The rest are various crash, hang or warn driver fixes"
* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] bfa: Fix crash when symb name set for offline vport
[SCSI] enclosure: fix WARN_ON in dual path device removing
[SCSI] pm80xx: Tasklets synchronization fix.
[SCSI] pm80xx: Resetting the phy state.
[SCSI] pm80xx: Fix for direct attached device.
[SCSI] pm80xx: Module author addition
[SCSI] hpsa: return 0 from driver probe function on success, not 1
[SCSI] hpsa: do not discard scsi status on aborted commands
[SCSI] Disable WRITE SAME for RAID and virtual host adapter drivers
[SCSI] libsas: fix usage of ata_tf_to_fis -
Pull IMA fixes from James Morris:
"Here are two more fixes for IMA"* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
ima: properly free ima_template_entry structures
ima: Do not free 'entry' before it is initialized -
Pull devicetree fixes from Rob Herring:
- Various DT binding documentation updates
- Add Kumar Gala and remove Stephen Warren as DT binding maintainers* tag 'dt-fixes-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
dt: binding: reword PowerPC 8xxx GPIO documentation
ARM: tegra: delete nvidia,tegra20-spi.txt binding
hwmon: ntc_thermistor: Fix typo (pullup-uV -> pullup-uv)
of: add vendor prefix for GMT
clk: exynos: Fix typos in DT bindings documentation
of: Add vendor prefix for LG Corporation
Documentation: net: fsl-fec.txt: Add phy-supply entry
ARM: dts: doc: Document missing binding for omap5-mpu
dt-bindings: add ARMv8 PMU binding
MAINTAINERS: remove swarren from DT bindings
MAINTAINERS: Add Kumar to Device Tree Binding maintainers group
06 Dec, 2013
1 commit
-
Clean up the aio ring file in the fail path of aio_setup_ring
and ioctx_alloc. And maybe it can fix the GPF issue reported by
Dave Jones:
https://lkml.org/lkml/2013/11/25/898Signed-off-by: Gu Zheng
Signed-off-by: Benjamin LaHaise