- 01 Mar, 2012 1 commit
-
-
Trond Myklebust authored
commit 331818f1 upstream. Commit bf118a34 (NFSv4: include bitmap in nfsv4 get acl data) introduces the 'acl_scratch' page for the case where we may need to decode multi-page data. However it fails to take into account the fact that the variable may be NULL (for the case where we're not doing multi-page decode), and it also attaches it to the encoding xdr_stream rather than the decoding one. The immediate result is an Oops in nfs4_xdr_enc_getacl due to the call to page_address() with a NULL page pointer. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Andy Adamson <andros@netapp.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 26 Jan, 2012 1 commit
-
-
Andy Adamson authored
commit bf118a34 upstream. The NFSv4 bitmap size is unbounded: a server can return an arbitrary sized bitmap in an FATTR4_WORD0_ACL request. Replace using the nfs4_fattr_bitmap_maxsz as a guess to the maximum bitmask returned by a server with the inclusion of the bitmap (xdr length plus bitmasks) and the acl data xdr length to the (cached) acl page data. This is a general solution to commit e5012d1f "NFSv4.1: update nfs4_fattr_bitmap_maxsz" and fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs. Fix a bug in decode_getacl that returned -EINVAL on ACLs > page when getxattr was called with a NULL buffer, preventing ACL > PAGE_SIZE from being retrieved. Signed-off-by:
Andy Adamson <andros@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@suse.de>
-
- 31 Oct, 2011 1 commit
-
-
Chuck Lever authored
Clean up: Remove superfluous logic at the tail of nfs4_xdr_dec_secinfo() . Introduced by commit 5a5ea0d4 "NFS: Add secinfo procedure" (March 24, 2011). Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 31 Jul, 2011 4 commits
-
-
Andy Adamson authored
This gives layout driver a chance to cleanup structures they put in at encode_layoutcommit. Signed-off-by:
Andy Adamson <andros@netapp.com> [fixup layout header pointer for layoutcommit] Signed-off-by:
Benny Halevy <bhalevy@panasas.com> Signed-off-by:
Benny Halevy <bhalevy@tonian.com> [rm inode and pnfs_layout_hdr args from cleanup_layoutcommit()] Signed-off-by:
Jim Rees <rees@umich.edu> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Fred Isaman authored
Block layout needs it to determine IO size. Signed-off-by:
Fred Isaman <iisaman@citi.umich.edu> Signed-off-by:
Tao Guo <glorioustao@gmail.com> Signed-off-by:
Benny Halevy <bhalevy@panasas.com> Signed-off-by:
Benny Halevy <bhalevy@tonian.com> Signed-off-by:
Jim Rees <rees@umich.edu> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Andy Adamson authored
The block driver uses GETDEVICELIST Signed-off-by:
Andy Adamson <andros@netapp.com> [pass struct nfs_server * to getdevicelist] [get machince creds for getdevicelist] [fix getdevicelist decode sizing] Signed-off-by:
Benny Halevy <bhalevy@panasas.com> Signed-off-by:
Benny Halevy <bhalevy@tonian.com> Signed-off-by:
Jim Rees <rees@umich.edu> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Peng Tao authored
Using NFS4_MAX_UINT64 will break current protocol. [Needed in v3.0] CC: Stable Tree <stable@kernel.org> Signed-off-by:
Peng Tao <peng_tao@emc.com> Signed-off-by:
Jim Rees <rees@umich.edu> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 12 Jul, 2011 4 commits
-
-
Bryan Schumaker authored
FREE_STATEID is used to tell the server that we want to free a stateid that no longer has any locks associated with it. This allows the client to reclaim locks without encountering edge conditions documented in section 8.4.3 of RFC 5661. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Bryan Schumaker authored
This patch adds in the xdr for doing a TEST_STATEID call with a single stateid. RFC 5661 allows multiple stateids to be tested in a single call, but only testing one keeps things simpler for now. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Bryan Schumaker authored
If the client is using NFS v4.1, then we can use SECINFO_NO_NAME to find the secflavor for the initial mount. If the server doesn't support SECINFO_NO_NAME then I fall back on the "guess and check" method used for v4.0 mounts. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Weston Andros Adamson authored
can be skipped if the "eir_server_scope" from the exchange_id proc differs from previous calls. Also, in the future server_scope will be useful for determining whether client trunking is available Signed-off-by:
Weston Andros Adamson <dros@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 11 Jul, 2011 1 commit
-
-
Andy Adamson authored
Attribute IDs assigned in RFC 5661 now require three bitmaps. Fixes hitting a BUG_ON in xdr_shrink_bufhead when getting ACLs. Signed-off-by:
Andy Adamson <andros@netapp.com> Cc:stable@kernel.org [2.6.39] Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 21 Jun, 2011 1 commit
-
-
Bryan Schumaker authored
I initially did the calculation in bytes, and not words Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 16 Jun, 2011 1 commit
-
-
Trond Myklebust authored
Commit 7ebb9315 (NFS: use secinfo when crossing mountpoints) introduces a regression when decoding an NFSv4 readdir entry that sets the rdattr_error field. By treating the resulting value as if it is a decoding error, the current code may cause us to skip valid readdir entries. Reported-by:
Andy Adamson <andros@netapp.com> Cc: stable@kernel.org [2.6.39] Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 15 Jun, 2011 1 commit
-
-
Benny Halevy authored
We don't support header padding yet so better off ditching it Reported-by:
Sid Moore <learnmost@gmail.com> Signed-off-by:
Benny Halevy <benny@tonian.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 29 May, 2011 3 commits
-
-
Benny Halevy authored
Add a layout driver method to encode the layout type specific opaque part of layout commit in-line in the xdr stream. Currently, the pnfs-objects layout driver uses it to encode metadata hints to the MDS and the blocks layout driver to commit provisionally allocated extents to the file. Signed-off-by:
Benny Halevy <bhalevy@panasas.com>
-
Andy Adamson authored
Add a layout driver method to encode the layout type specific opaque part of layout return in-line in the xdr stream. Currently the pnfs-objects layout driver uses it to encode i/o error information on LAYOUTRETURN. Signed-off-by:
Andy Adamson <andros@netapp.com> [fixup layout header pointer for encode_layoutreturn] Signed-off-by:
Benny Halevy <bhalevy@panasas.com>
-
Benny Halevy authored
NFSv4.1 LAYOUTRETURN implementation Currently, does not support layout-type payload encoding. Signed-off-by:
Alexandros Batsakis <batsakis@netapp.com> Signed-off-by:
Andy Adamson <andros@citi.umich.edu> Signed-off-by:
Andy Adamson <andros@netapp.com> Signed-off-by:
Dean Hildebrand <dhildeb@us.ibm.com> Signed-off-by:
Fred Isaman <iisaman@citi.umich.edu> Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Marc Eshel <eshel@almaden.ibm.com> Signed-off-by:
Zhang Jingwang <zhangjingwang@nrchpc.ac.cn> [call pnfs_return_layout right before pnfs_destroy_layout] [remove assert_spin_locked from pnfs_clear_lseg_list] [remove wait parameter from the layoutreturn path.] [remove return_type field from nfs4_layoutreturn_args] [remove range from nfs4_layoutreturn_args] [no need to send layoutcommit from _pnfs_return_layout] [don't wait on sync layoutreturn] [fix layout stateid in layoutreturn args] [fixed NULL deref in _pnfs_return_layout] [removed recaim member of nfs4_layoutreturn_args] Signed-off-by:
Benny Halevy <bhalevy@panasas.com>
-
- 27 Apr, 2011 2 commits
-
-
Bryan Schumaker authored
When compiling, I was getting this warning: fs/nfs/nfs4xdr.c: In function ‘decode_secinfo’: fs/nfs/nfs4xdr.c:4839:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] We were unconditionally returning 0 as long as there wasn't an error coming out of xdr_inline_decode(). We probably want to check the error status coming out of decode_op_hdr() and decode_secinfo_gss(), rather than assuming that everything is OK all the time. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Trond Myklebust authored
When readdir() returns a directory entry for the root of a mounted filesystem, Linux follows the old convention of returning the inode number of the covered directory (despite newer versions of POSIX declaring that this is a bug). To ensure this continues to work, the NFSv4 readdir implementation requests the 'mounted-on-fileid' from the server. However, readdirplus also needs to instantiate an inode for this entry, and for that, we also need to request the real fileid as per this patch. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 13 Apr, 2011 1 commit
-
-
Bryan Schumaker authored
While decoding a secinfo reply, I store the list of supported sec flavors on a page accessible through res->flavors. Before reading each new flavor, I do some math to determine if there is enough space left on this page, and I break out of my read look if there isn't. In order to perform this check correctly, I need to use the address of res->flavors, rather than the address of res. When this loop was broken early I lied to the caller and told them that the entire list had been decoded. This could lead to problems if the caller tries to use any the garbage data claiming to be a valid sec flavor. I fixed this by using res->flavors->num_flavors as a counter, incrementing it every time a sec flavor is successfully decoded. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 24 Mar, 2011 3 commits
-
-
Weston Andros Adamson authored
changes LAYOUTGET and GETDEVICEINFO XDR parsing to: - not use vmap, which doesn't work on incoherent archs - use xdr_stream parsing for all xdr Signed-off-by:
Weston Andros Adamson <dros@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Bryan Schumaker authored
A submount may use different security than the parent mount does. We should figure out what sec flavor the submount uses at mount time. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Bryan Schumaker authored
This patch adds the nfs4 operation secinfo as a valid nfs rpc operation. Signed-off-by:
Bryan Schumaker <bjschuma@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 23 Mar, 2011 2 commits
-
-
Andy Adamson authored
The filelayout driver sends LAYOUTCOMMIT only when COMMIT goes to the data server (as opposed to the MDS) and the data server WRITE is not NFS_FILE_SYNC. Only whole file layout support means that there is only one IOMODE_RW layout segment. Signed-off-by:
Andy Adamson <andros@netapp.com> Signed-off-by:
Alexandros Batsakis <batsakis@netapp.com> Signed-off-by:
Boaz Harrosh <bharrosh@panasas.com> Signed-off-by:
Dean Hildebrand <dhildeb@us.ibm.com> Signed-off-by:
Fred Isaman <iisaman@citi.umich.edu> Signed-off-by:
Mingyang Guo <guomingyang@nrchpc.ac.cn> Signed-off-by:
Tao Guo <guotao@nrchpc.ac.cn> Signed-off-by:
Zhang Jingwang <zhangjingwang@nrchpc.ac.cn> Tested-by:
Boaz Harrosh <bharrosh@panasas.com> Signed-off-by:
Benny Halevy <bhalevy@panasas.com> Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Fred Isaman authored
Any COMMIT compound directed to a data server needs to have the GETATTR calls suppressed. We here, make sure the field we are testing (data->lseg) is set and refcounted correctly. Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 11 Mar, 2011 4 commits
-
-
Trond Myklebust authored
This will be required in order to switch uid/gid mapping back on if the admin has tried to disable it. Note that we also propagate NFS4ERR_BADNAME at the same time, in order to work around a Linux server bug. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Trond Myklebust authored
...instead of the nfs_client. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Fred Isaman authored
Any WRITE compound directed to a data server needs to have the GETATTR calls suppressed. Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Andy Adamson authored
Data servers require a zero stateid seqid, and there is no advantage to not doing the same for all NFSv4.1 Signed-off-by:
Andy Adamson <andros@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 10 Mar, 2011 1 commit
-
-
Andy Adamson authored
Signed-off-by:
Andy Adamson <andros@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 28 Jan, 2011 2 commits
-
-
Chuck Lever authored
On recent 2.6.38-rc kernels, connectathon basic test 6 fails on NFSv4 mounts of OpenSolaris with something like: > ./test6: readdir > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.12' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.82' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) didn't read expected 'file.164' dir entry, pass 0 > ./test6: (/mnt/klimt/matisse.test) Test failed with 3 errors > basic tests failed > Tests failed, leaving /mnt/klimt mounted > [cel@matisse cthon04]$ I narrowed the problem down to nfs4_decode_dirent() reporting that the decode buffer had overflowed while decoding the entries for those missing files. verify_attr_len() assumes both it's pointer arguments reside on the same page. When these arguments point to locations on two different pages, verify_attr_len() can report false errors. This can happen now that a large NFSv4 readdir result can span pages. We have reasonably good checking in nfs4_decode_dirent() anyway, so it should be safe to simply remove the extra checking. At a guess, this was introduced by commit 6650239a , "NFS: Don't use vm_map_ram() in readdir". Cc: stable@kernel.org [2.6.37] Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Chuck Lever authored
Make the decoding of NFSv4 directory entries slightly more efficient by: 1. Avoiding unnecessary byte swapping when checking XDR booleans, and 2. Not bumping "p" when its value will be immediately replaced by xdr_inline_decode() This commit makes nfs4_decode_dirent() consistent with similar logic in the other two decode_dirent() functions. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 10 Jan, 2011 1 commit
-
-
Trond Myklebust authored
vm_map_ram() is not available on NOMMU platforms, and causes trouble on incoherrent architectures such as ARM when we access the page data through both the direct and the virtual mapping. The alternative is to use the direct mapping to access page data for the case when we are not crossing a page boundary, but to copy the data into a linear scratch buffer when we are accessing data that spans page boundaries. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com> Tested-by:
Marc Kleine-Budde <mkl@pengutronix.de> Cc: stable@kernel.org [2.6.37]
-
- 06 Jan, 2011 3 commits
-
-
Trond Myklebust authored
In order to enable migration support, we will want to move some of the structures that are subject to migration into the struct nfs_server. In particular, if we are to move the state_owner and state_owner_id to being a per-filesystem structure, then we should label the resulting open/lock owners with a per-filesytem label to ensure global uniqueness. This patch does so by adding the super block s_dev to the open/lock owner name. Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Fred Isaman authored
We shouldn't send a LAYOUTGET(openstateid) unless all outstanding RPCs using the previous stateid are completed. This requires choosing the stateid to encode earlier, so we can abort if one is not available (we want to use the open stateid, but a LAYOUTGET is already out using it), and adding a count of the number of outstanding rpc calls using layout state (which for now consist solely of LAYOUTGETs). Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Fred Isaman authored
This prepares for future changes, where the layout state needs to change atomically with several other variables. In particular, it will need to know if lo->segs is empty, as we test that instead of manipulating the NFS_LAYOUT_STATEID_SET bit. Moreover, the layoutstateid is not really a read-mostly structure, as it is written almost as often as it is read. The behavior of pnfs_get_layout_stateid is also slightly changed, so that it no longer changes the stateid. Its name is changed to +pnfs_choose_layoutget_stateid. Signed-off-by:
Fred Isaman <iisaman@netapp.com> Signed-off-by:
Benny Halevy <bhalevy@panasas.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
- 16 Dec, 2010 3 commits
-
-
Chuck Lever authored
Now that all client-side XDR decoder routines use xdr_streams, there should be no need to support the legacy calling sequence [rpc_rqst *, __be32 *, RPC res *] anywhere. We can construct an xdr_stream in the generic RPC code, instead of in each decoder function. This is a refactoring change. It should not cause different behavior. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Tested-by:
J. Bruce Fields <bfields@redhat.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Chuck Lever authored
Now that all client-side XDR encoder routines use xdr_streams, there should be no need to support the legacy calling sequence [rpc_rqst *, __be32 *, RPC arg *] anywhere. We can construct an xdr_stream in the generic RPC code, instead of in each encoder function. Also, all the client-side encoder functions return 0 now, making a return value superfluous. Take this opportunity to convert them to return void instead. This is a refactoring change. It should not cause different behavior. Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Tested-by:
J. Bruce Fields <bfields@redhat.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-
Chuck Lever authored
Clean up. .../linux/nfs-2.6/fs/nfs/nfs4xdr.c: In function ‘decode_getdeviceinfo’: .../linux/nfs-2.6/fs/nfs/nfs4xdr.c:5008: warning: comparison between signed and unsigned integer expressions Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Tested-by:
J. Bruce Fields <bfields@redhat.com> Signed-off-by:
Trond Myklebust <Trond.Myklebust@netapp.com>
-