aboutsummaryrefslogtreecommitdiff
path: root/fs
AgeCommit message (Collapse)AuthorFilesLines
2011-03-23bitops: remove ext2 non-atomic bitops from asm/bitops.hAkinobu Mita1-0/+6
As the result of conversions, there are no users of ext2 non-atomic bit operations except for ext2 filesystem itself. Now we can put them into architecture independent code in ext2 filesystem, and remove from asm/bitops.h for all architectures. Signed-off-by: Akinobu Mita <[email protected]> Cc: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23ufs: use little-endian bitopsAkinobu Mita1-1/+1
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <[email protected]> Cc: Evgeniy Dushistov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23udf: use little-endian bitopsAkinobu Mita1-5/+4
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23nilfs2: use little-endian bitopsAkinobu Mita1-1/+1
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Ryusuke Konishi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23ocfs2: use little-endian bitopsAkinobu Mita1-5/+5
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: Joel Becker <[email protected]> Cc: Mark Fasheh <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23ext4: use little-endian bitopsAkinobu Mita1-6/+6
As a preparation for removing ext2 non-atomic bit operations from asm/bitops.h. This converts ext2 non-atomic bit operations to little-endian bit operations. Signed-off-by: Akinobu Mita <[email protected]> Acked-by: "Theodore Ts'o" <[email protected]> Cc: Andreas Dilger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23fs/adfs/adfs.h: fix unsigned comparisonAndrew Morton1-1/+1
fs/adfs/adfs.h: In function 'append_filetype_suffix': fs/adfs/adfs.h:115: warning: comparison is always false due to limited range of data type Reported-by: Geert Uytterhoeven <[email protected]> Cc: Stuart Swales <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-23deal with races in /proc/*/{syscall,stack,personality}Al Viro1-19/+50
All of those are rw-r--r-- and all are broken for suid - if you open a file before the target does suid-root exec, you'll be still able to access it. For personality it's not a big deal, but for syscall and stack it's a real problem. Fix: check that task is tracable for you at the time of read(). Signed-off-by: Al Viro <[email protected]>
2011-03-23proc: enable writing to /proc/pid/memStephen Wilson1-5/+0
With recent changes there is no longer a security hazard with writing to /proc/pid/mem. Remove the #ifdef. Signed-off-by: Stephen Wilson <[email protected]> Signed-off-by: Al Viro <[email protected]>
2011-03-23proc: make check_mem_permission() return an mm_struct on successStephen Wilson1-24/+34
This change allows us to take advantage of access_remote_vm(), which in turn eliminates a security issue with the mem_write() implementation. The previous implementation of mem_write() was insecure since the target task could exec a setuid-root binary between the permission check and the actual write. Holding a reference to the target mm_struct eliminates this vulnerability. Signed-off-by: Stephen Wilson <[email protected]> Signed-off-by: Al Viro <[email protected]>
2011-03-23proc: hold cred_guard_mutex in check_mem_permission()Stephen Wilson1-4/+22
Avoid a potential race when task exec's and we get a new ->mm but check against the old credentials in ptrace_may_access(). Holding of the mutex is implemented by factoring out the body of the code into a helper function __check_mem_permission(). Performing this factorization now simplifies upcoming changes and minimizes churn in the diff's. Signed-off-by: Stephen Wilson <[email protected]> Signed-off-by: Al Viro <[email protected]>
2011-03-23proc: disable mem_write after execStephen Wilson1-0/+4
This change makes mem_write() observe the same constraints as mem_read(). This is particularly important for mem_write as an accidental leak of the fd across an exec could result in arbitrary modification of the target process' memory. IOW, /proc/pid/mem is implicitly close-on-exec. Signed-off-by: Stephen Wilson <[email protected]> Signed-off-by: Al Viro <[email protected]>
2011-03-23mm: arch: make get_gate_vma take an mm_struct instead of a task_structStephen Wilson2-4/+6
Morally, the presence of a gate vma is more an attribute of a particular mm than a particular task. Moreover, dropping the dependency on task_struct will help make both existing and future operations on mm's more flexible and convenient. Signed-off-by: Stephen Wilson <[email protected]> Reviewed-by: Michel Lespinasse <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Signed-off-by: Al Viro <[email protected]>
2011-03-23auxv: require the target to be tracable (or yourself)Al Viro1-3/+3
same as for environ, except that we didn't do any checks to prevent access after suid execve Signed-off-by: Al Viro <[email protected]>
2011-03-23close race in /proc/*/environAl Viro1-6/+4
Switch to mm_for_maps(). Maybe we ought to make it r--r--r--, since we do checks on IO anyway... Signed-off-by: Al Viro <[email protected]>
2011-03-23report errors in /proc/*/*map* sanelyAl Viro3-11/+13
Signed-off-by: Al Viro <[email protected]>
2011-03-23pagemap: close races with suid execveAl Viro2-7/+4
just use mm_for_maps() Signed-off-by: Al Viro <[email protected]>
2011-03-23make sessionid permissions in /proc/*/task/* match those in /proc/*Al Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2011-03-23ext4: fix a BUG in mb_mark_used during trim.Tao Ma1-3/+8
In a bs=4096 volume, if we call FITRIM with the following parameter as fstrim_range(start = 102400, len = 134144000, minlen = 10240), we will trigger this BUG_ON: BUG_ON(start + len > (e4b->bd_sb->s_blocksize << 3)); Mar 4 00:55:52 boyu-tm kernel: ------------[ cut here ]------------ Mar 4 00:55:52 boyu-tm kernel: kernel BUG at fs/ext4/mballoc.c:1506! Mar 4 01:21:09 boyu-tm kernel: Code: d4 00 00 00 00 49 89 fe 8b 56 0c 44 8b 7e 04 89 55 c4 48 8b 4f 28 89 d6 44 01 fe 48 63 d6 48 8b 41 18 48 c1 e0 03 48 39 c2 76 04 <0f> 0b eb fe 48 8b 55 b0 8b 47 34 3b 42 08 74 04 0f 0b eb fe 48 Mar 4 01:21:09 boyu-tm kernel: RIP [<ffffffffa053eb42>] mb_mark_used+0x47/0x26c [ext4] Mar 4 01:21:09 boyu-tm kernel: RSP <ffff880121e45c38> Mar 4 01:21:09 boyu-tm kernel: ---[ end trace 9f461696f6a9dcf2 ]--- Fix this bug by doing the accounting correctly. Cc: Lukas Czerner <[email protected]> Signed-off-by: Tao Ma <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2011-03-23NFSv4.1 remove temp code that prevented ds commitsFred Isaman1-4/+0
Now that all the infrastructure is in place, we will do the right thing if we remove this special casing. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: layoutcommitAndy Adamson8-2/+362
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 <[email protected]> Signed-off-by: Alexandros Batsakis <[email protected]> Signed-off-by: Boaz Harrosh <[email protected]> Signed-off-by: Dean Hildebrand <[email protected]> Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Mingyang Guo <[email protected]> Signed-off-by: Tao Guo <[email protected]> Signed-off-by: Zhang Jingwang <[email protected]> Tested-by: Boaz Harrosh <[email protected]> Signed-off-by: Benny Halevy <[email protected]> Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: filelayout driver specific code for COMMITFred Isaman5-7/+265
Implement all the hooks created in the previous patches. This requires exporting quite a few functions and adding a few structure fields. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: remove GETATTR from ds commitsFred Isaman3-7/+16
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 <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: add generic layer hooks for pnfs COMMITFred Isaman3-17/+102
We create three major hooks for the pnfs code. pnfs_mark_request_commit() is called during writeback_done from nfs_mark_request_commit, which gives the driver an opportunity to claim it wants control over commiting a particular req. pnfs_choose_commit_list() is called from nfs_scan_list to choose which list a given req should be added to, based on where we intend to send it for COMMIT. It is up to the driver to have preallocated list headers for each destination it may need. pnfs_commit_list() is how the driver actually takes control, it is used instead of nfs_commit_list(). In order to pass information between the above functions, we create a union in nfs_page to hold a lseg (which is possible because the req is not on any list while in transition), and add some flags to indicate if we need to use the pnfs code. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: alloc and free commit_bucketsFred Isaman2-0/+24
Create a preallocated list header to hold nfs_pages for each non-MDS COMMIT destination. Note this is not necessarily each DS, but is basically each <DS, fh> pair. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: shift filelayout_free_lsegFred Isaman1-10/+10
Move it up to avoid forward declaration in later patch. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: pull out code from nfs_commit_releaseFred Isaman1-3/+9
Create a separate support function for later use by data server commit code. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: pull error handling out of nfs_commit_listFred Isaman1-10/+16
Create a separate support function for later use by data server commit code. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: add callback to nfs4_commit_doneFred Isaman1-4/+10
Add a callback that the pnfs layout driver can use to do its own error handling of the data server's COMMIT response. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: rearrange nfs_commit_rpcsetupFred Isaman1-27/+33
Reorder nfs_commit_rpcsetup, preparing for a pnfs entry point. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFSv4.1: don't send COMMIT to ds for data sync writesFred Isaman1-1/+4
Based on consensus reached in Feb 2011 interim IETF meeting regarding use of LAYOUTCOMMIT, it has been decided that a NFS_DATA_SYNC return from a WRITE to data server should not initiate a COMMIT. Signed-off-by: Fred Isaman <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFS: Detect loops in a readdir due to bad cookiesBryan Schumaker1-1/+27
Some filesystems (such as ext4) can return the same cookie value for multiple files. If we try to start a readdir with one of these cookies, the server will return the first file found with a cookie of the same value. This can cause the client to enter an infinite loop. Signed-off-by: Bryan Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFS: Create nfs_open_dir_contextBryan Schumaker2-8/+47
nfs_opendir() created a context that held much more information than we need for a readdir. This patch introduces a slimmed-down nfs_open_dir_context that contains only the cookie and the cred used for RPC operations. The new context will eventually be used to help detect readdir loops. Signed-off-by: Bryan Schumaker <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23NFS: Ensure that we update the readdir filp->f_pos correctlyTrond Myklebust1-1/+2
If we're doing a search by readdir cookie, we need to ensure that the resulting f_pos is updated. To do so, we need to update the desc->current_index, in the same way that we do in the search by file offset case. Signed-off-by: Trond Myklebust <[email protected]>
2011-03-23ext4: unused variables cleanup in fs/ext4/extents.cSergey Senozhatsky1-4/+1
ext4 extents cleanup: . remove unused `*ex' from check_eofblocks_fl . remove unused `*eh' from ext4_ext_map_blocks Signed-off-by: Sergey Senozhatsky <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2011-03-23ext4: remove redundant set_buffer_mapped() in ext4_da_get_block_prep()Feng Tang1-1/+0
The map_bh() call will have already set the buffer_head to mapped. Signed-off-by: Feng Tang <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
2011-03-23fix leaks in path_lookupat()Al Viro1-2/+5
Signed-off-by: Al Viro <[email protected]>
2011-03-22zlib: slim down zlib_deflate() workspace when possibleJim Keniston3-5/+7
Instead of always creating a huge (268K) deflate_workspace with the maximum compression parameters (windowBits=15, memLevel=8), allow the caller to obtain a smaller workspace by specifying smaller parameter values. For example, when capturing oops and panic reports to a medium with limited capacity, such as NVRAM, compression may be the only way to capture the whole report. In this case, a small workspace (24K works fine) is a win, whether you allocate the workspace when you need it (i.e., during an oops or panic) or at boot time. I've verified that this patch works with all accepted values of windowBits (positive and negative), memLevel, and compression level. Signed-off-by: Jim Keniston <[email protected]> Cc: Herbert Xu <[email protected]> Cc: David Miller <[email protected]> Cc: Chris Mason <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22fs/devpts/inode.c: correctly check d_alloc_name() return code in ↵Andrey Vagin1-1/+1
devpts_pty_new() d_alloc_name return NULL in case error, but we expect errno in devpts_pty_new. Addresses http://bugzilla.openvz.org/show_bug.cgi?id=1758 Signed-off-by: Andrey Vagin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22aio: wake all waiters when destroying ctxRoland Dreier1-2/+2
The test program below will hang because io_getevents() uses add_wait_queue_exclusive(), which means the wake_up() in io_destroy() only wakes up one of the threads. Fix this by using wake_up_all() in the aio code paths where we want to make sure no one gets stuck. // t.c -- compile with gcc -lpthread -laio t.c #include <libaio.h> #include <pthread.h> #include <stdio.h> #include <unistd.h> static const int nthr = 2; void *getev(void *ctx) { struct io_event ev; io_getevents(ctx, 1, 1, &ev, NULL); printf("io_getevents returned\n"); return NULL; } int main(int argc, char *argv[]) { io_context_t ctx = 0; pthread_t thread[nthr]; int i; io_setup(1024, &ctx); for (i = 0; i < nthr; ++i) pthread_create(&thread[i], NULL, getev, ctx); sleep(1); io_destroy(ctx); for (i = 0; i < nthr; ++i) pthread_join(thread[i], NULL); return 0; } Signed-off-by: Roland Dreier <[email protected]> Reviewed-by: Jeff Moyer <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22adfs: add hexadecimal filetype suffix optionStuart Swales5-26/+81
ADFS (FileCore) storage complies with the RISC OS filetype specification (12 bits of file type information is stored in the file load address, rather than using a file extension). The existing driver largely ignores this information and does not present it to the end user. It is desirable that stored filetypes be made visible to the end user to facilitate a precise copy of data and metadata from a hard disc (or image thereof) into a RISC OS emulator (such as RPCEmu) or to a network share which can be accessed by real Acorn systems. This patch implements a per-mount filetype suffix option (use -o ftsuffix=1) to present any filetype as a ,xyz hexadecimal suffix on each file. This type suffix is compatible with that used by RISC OS systems that access network servers using NFS client software and by RPCemu's host filing system. Signed-off-by: Stuart Swales <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22adfs: improve timestamp precisionStuart Swales1-21/+19
ADFS (FileCore) storage complies with the RISC OS timestamp specification (40-bit centiseconds since 01 Jan 1900 00:00:00). It is desirable that stored timestamp precision be maintained to facilitate a precise copy of data and metadata from a hard disc (or image thereof) into a RISC OS emulator (such as RPCEmu). This patch implements a full-precision conversion from ADFS to Unix timestamp as the existing driver, for ease of calculation with old 32-bit compilers, uses the common trick of shifting the 40-bits representing centiseconds around into 32-bits representing seconds thereby losing precision. Signed-off-by: Stuart Swales<[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22adfs: fix E+/F+ dir size > 2048 crashing kernelStuart Swales2-21/+84
Kernel crashes in fs/adfs module when accessing directories with a large number of objects on mounted Acorn ADFS E+/F+ format discs (or images) as the existing code writes off the end of the fixed array of struct buffer_head pointers. Additionally, each directory access that didn't crash would leak a buffer as nr_buffers was not adjusted correctly for E+/F+ discs (was always left as one less than required). The patch fixes this by allocating a dynamically-sized set of struct buffer_head pointers if necessary for the E+/F+ case (many directories still do in fact fit in 2048 bytes) and sets the correct nr_buffers so that all buffers are released. Addresses https://bugzilla.kernel.org/show_bug.cgi?id=26072 Tested by tar'ing the contents of my RISC PC's E+ format 20Gb HDD which contains a number of large directories that previously crashed the kernel. Signed-off-by: Stuart Swales <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22codafs: fix compile warning when CONFIG_SYSCTL=nRakib Mullick1-7/+1
When CONFIG_SYSCTL=n, we get the following warning: fs/coda/sysctl.c:18: warning: `coda_tabl' defined but not used Fix the warning by making sure coda_table and it's callee function are in the same context. Also clean up the code by removing extra #ifdef. [[email protected]: remove unneeded stub macros] Signed-off-by: Rakib Mullick <[email protected]> Cc: Jan Harkes <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22binfmt_elf: quiet GCC-4.6 'set but not used' warning in load_elf_binary()David Daney1-1/+1
With GCC-4.6 we get warnings about things being 'set but not used'. In load_elf_binary() this can happen with reloc_func_desc if ELF_PLAT_INIT is defined, but doesn't use the reloc_func_desc argument. Quiet the warning/error by marking reloc_func_desc as __maybe_unused. Signed-off-by: David Daney <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22epoll: fix compiler warning and optimize the non-blocking pathShawn Bohrer1-5/+28
Add a comment to ep_poll(), rename labels a bit clearly, fix a warning of unused variable from gcc and optimize the non-blocking path a little. Hinted-by: Andrew Morton <[email protected]> Signed-off-by: Davide Libenzi <[email protected]> [email protected]: : The non-blocking ep_poll path optimization introduced skipping over the : return value setup. : : Initialize it properly, my userspace gets upset by epoll_wait() returning : random things. : : In addition, remove the reinitialization at the fetch_events label, the : return value is garuanteed to be zero when execution reaches there. [[email protected]: fix initialization] Signed-off-by: Johannes Weiner <[email protected]> Cc: Shawn Bohrer <[email protected]> Acked-by: Davide Libenzi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22epoll: move ready event check into proper inlineDavide Libenzi1-3/+16
Move the event readiness check into a proper inline, and use it uniformly inside ep_poll() code. Events in the ->ovflist are no less ready than the ones in ->rdllist. Signed-off-by: Davide Libenzi <[email protected]> Cc: Shawn Bohrer <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22fs: use appropriate printk priority levelsMandeep Singh Baines2-2/+2
printk()s without a priority level default to KERN_WARNING. To reduce noise at KERN_WARNING, this patch set the priority level appriopriately for unleveled printks()s. This should be useful to folks that look at dmesg warnings closely. Signed-off-by: Mandeep Singh Baines <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Al Viro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22smaps: have smaps show transparent huge pagesDave Hansen1-0/+4
Now that the mere act of _looking_ at /proc/$pid/smaps will not destroy transparent huge pages, tell how much of the VMA is actually mapped with them. This way, we can make sure that we're getting THPs where we expect to see them. Signed-off-by: Dave Hansen <[email protected]> Acked-by: Mel Gorman <[email protected]> Acked-by: David Rientjes <[email protected]> Reviewed-by: Eric B Munson <[email protected]> Tested-by: Eric B Munson <[email protected]> Cc: Michael J Wolf <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Matt Mackall <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-03-22smaps: teach smaps_pte_range() about THP pmdsDave Hansen1-2/+21
This adds code to explicitly detect and handle pmd_trans_huge() pmds. It then passes HPAGE_SIZE units in to the smap_pte_entry() function instead of PAGE_SIZE. This means that using /proc/$pid/smaps now will no longer cause THPs to be broken down in to small pages. Signed-off-by: Dave Hansen <[email protected]> Reviewed-by: Eric B Munson <[email protected]> Tested-by: Eric B Munson <[email protected]> Acked-by: Andrea Arcangeli <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Michael J Wolf <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Matt Mackall <[email protected]> Cc: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>